Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/en/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1422,6 +1422,8 @@ Options of `ui-ux` and `security`:
- `--start`: Starts the solution's default run profile (containers, tasks, build and applications) before the test, and stops it afterwards.
- `--profile`: The run profile `--start` uses.
- `--changed-since`: Reviews only the code changed since a git ref (`origin/main`), a date (`2026-11-01`) or a time span (`7d`, `2w`).
- `--page`: Tests one page instead of the whole application, as `[Name=]<path>` (such as `Web=/Orders`) or a full address. Default: the inputs file's `page`.
- `--page-files`: With `--page`, the page's source files, comma-separated and relative to the solution folder. Default: found by the AI.
- `--model`: The model to test with.
- `--output`: The report folder. Default: `TestResults/ui-ux` or `TestResults/security`.
- `--fail-on`: Which findings fail the test. `ui-ux`: `defect` (default), `confirmed`, `high` or `none`. `security`: `high` (default), `any`, `confirmed` or `none`.
Expand All @@ -1444,6 +1446,7 @@ abp test ui-ux --mode both --start
abp test security --url Web=https://localhost:44302 --fail-on confirmed
abp test security --mode codebase --changed-since origin/main
abp test ui-ux --mode codebase --changed-since 7d
abp test security --url Web=https://localhost:44302 --page Web=/Orders
abp test init-ci
```

Expand Down
22 changes: 21 additions & 1 deletion docs/en/studio/ai-testing-on-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ abp test security --solution MyCompany.MyProject.abpsln --mode both --start
| `--start` | Starts the solution's default run profile before the test, and stops what it started afterwards. |
| `--profile` | The run profile `--start` uses, instead of the default one. |
| `--changed-since` | Reviews only the code changed since a git ref (`origin/main`), a date (`2026-11-01`) or a time span (`7d`, `2w`, `12h`, `3mo`). |
| `--page [Name=]<path>` | Tests one page instead of the whole application, such as `Web=/Orders`, or a full address. See [Testing a page](#testing-a-page). Default: the inputs file's `page`. |
| `--page-files <files>` | With `--page`: the page's source files, comma-separated and relative to the solution folder. Default: found by the AI. |
| `--model` | The model to test with. Default: the inputs file's model, else the default model. |
| `--output` | The report folder. Default: `TestResults/ui-ux` or `TestResults/security`. |
| `--fail-on` | Which findings fail the test (exit code `1`). See below. |
Expand Down Expand Up @@ -81,20 +83,38 @@ Free the applications' ports first: an application already holding one is stoppe

A date and a time span are resolved from the git history, so they also work on CI, where the checkout has the full history (`fetch-depth: 0`). The test prints the commit it counted from.

### Testing a page

`--page` tests [one page](ai-testing.md#testing-a-page) of an application instead of the whole application:

```bash
abp test security --solution MyCompany.MyProject.abpsln --mode both --url Web=https://localhost:44302 --page Web=/Orders
abp test ui-ux --solution MyCompany.MyProject.abpsln --mode codebase --page /Orders --page-files src/MyCompany.MyProject.Web/Pages/Orders/Index.cshtml,src/MyCompany.MyProject.Web/Pages/Orders/Index.cshtml.cs
```

- The name before `=` is the application's name in `--url` (or in the inputs file's `targets`); it can be left out when there is one application. A full address, such as `https://localhost:44302/Orders`, names the application by its address.
- Only that application is tested. Without `--page-files`, the AI finds the page's files, and the Security Test also reads the page's API calls from the running application.
- The test prints what it covers before it starts: the page, its files, its API calls, and the address of its API when the page calls it in another application (such as a React or Angular page's API host; give that application in `--url` too).
- A test that reviews the code only, of a page whose files cannot be found, stops with exit code `2`. Name the files with `--page-files`.

The inputs file can hold the page too, as `page` (see [the inputs file](ai-testing.md#the-inputs-file)); `--page` wins over it.

## Reports

| Test | Files |
| --- | --- |
| `ui-ux` | `ui-ux-test.json` and `ui-ux-test.md`, with the screenshots beside them |
| `security` | `security-test.json`, `security-test.md` and `security-test.sarif` |

The reports of a page's test name the page: a *Page tested* line under the Markdown title, `scope` at the top of the JSON, and `scope` in the `properties` of the SARIF run.

## Exit Codes

| Code | Meaning |
| --- | --- |
| `0` | Passed. |
| `1` | Findings past `--fail-on`. |
| `2` | Error: the test could not run or finish (for example, the applications did not start, the sign-in failed, or the code review failed). |
| `2` | Error: the test could not run or finish (for example, the applications did not start, the sign-in failed, the code review failed, or the page given with `--page` has no application or no files to review). |
| `3` | The AI stopped the test (for example, no credits left). The report holds what was found until then. |
| `4` | The AI cannot be used: sign in, or check the license. |

Expand Down
25 changes: 22 additions & 3 deletions docs/en/studio/ai-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ABP Studio has two AI-powered tests for the open solution:
- **[UI/UX Test](ui-ux-test.md)** checks the pages of the running applications and the UI code for broken layouts, accessibility problems, missing translations and pages that do not work as they should.
- **[Security Test](security-test.md)** reviews the code for vulnerabilities and attacks the running applications the way a penetration tester would.

Both tests are opened from the menu bar, use the same inputs, show their findings the same way, and can send the findings to the [AI Agent](ai-agent.md) to be fixed. They also run without the UI, from the [ABP CLI and on CI](ai-testing-on-ci.md).
Both tests are opened from the menu bar, use the same inputs, show their findings the same way, and can send the findings to the [AI Agent](ai-agent.md) to be fixed. They test the whole application, or [a single page](#testing-a-page) of it. They also run without the UI, from the [ABP CLI and on CI](ai-testing-on-ci.md).

## Codebase and Runtime

Expand All @@ -49,12 +49,26 @@ Only one of the two tests (or a re-verification) runs at a time.
2. Choose the mode: *Codebase + Runtime*, *Codebase* or *Runtime*.
3. Tick the running applications under *Apps to Test*.
4. Optionally pick a model in *Test with*, and click *Configure Inputs* to add test accounts or instructions.
5. Click *Start Test*.
5. Click *Start Test* and choose *Test the whole application*.

*Stop Test* ends the test after the step it is on and keeps the findings found so far; the status reads *Stopping…* until then. Clicking *Stop Test* again while it waits, and confirming with *Stop Now*, ends the test at once, and nothing from that run is kept. If the AI can no longer be used (no credits left, a rejected key, or the AI access was lost), the test stops the same way as *Stop Test* and says why.

With *Incremental* on, the code review covers only the files changed since the last test, and the findings of the other files are carried over. The running applications are always tested in full.

## Testing a Page

A test can cover one page instead of the whole application, for example a page you have just built. Click *Start Test* and choose *Test a page…*, or right-click a running application in the [Solution Runner](running-applications.md) and choose *AI Testing* → *Test a Page (UI/UX)...* or *Test a Page (Security)...*, which opens the test with that application chosen.

1. Choose the *App* the page belongs to, and type the *Page path*, such as `/Orders`. A full address pasted from the browser, such as `https://localhost:44302/Orders`, fills in both.
2. Optionally list the *Page files*, one per line, relative to the solution folder. Leave them empty, and the AI finds them.
3. Click *Find Scope*. The AI finds the page's files: the page itself, its dialogs, and the services, controllers and DTOs it calls. The Security Test also lists the *API calls* behind the page. Finding the scope makes a few AI calls.
4. Check what the test will cover, and remove what does not belong to the page. *Back* returns to the page path.
5. Click *Start Test*.

The test covers that page only: its main content, its files and the API calls it makes. The menu, the header and the footer every page shares are left to the test of the whole application. What each test does with the page is described on its page ([UI/UX Test](ui-ux-test.md#testing-a-page), [Security Test](security-test.md#testing-a-page)).

The *Codebase* part needs the page's files. If none is left, start the test with *Runtime* only, which tests the running page.

## Test Inputs

Click *Configure Inputs* to set:
Expand Down Expand Up @@ -105,6 +119,7 @@ Passwords are never written to the file. Each account names an environment varia
| `accounts` | Up to two accounts: `username` and `passwordEnv`, the name of the environment variable that holds the password. |
| `instructions` / `instructionsFile` | The test instructions, as text or as a Markdown file inside the solution folder. |
| `viewports` | UI/UX Test only: the screen widths to test the pages at (`360`, `768`, `1280`, `1920`). |
| `page` | Used by the CLI: a page to test instead of the whole application, with `app` (the name of one of the `targets`, or left out when there is one), `path` (such as `/Orders`, or a full address) and optionally `files`. See [Testing a page](ai-testing-on-ci.md#testing-a-page). |

The Security Test file also holds the test's [policy](security-test.md#policy): `scope`, `suppress` and `severityOverrides`. Saving the inputs from Studio keeps these fields as they are.

Expand All @@ -114,9 +129,13 @@ So that a cloned repository cannot send the passwords elsewhere, the `targets` a

The findings are listed with the most severe first. The last results of the open solution are shown again when the test is opened.

The results are kept for the whole application and for each tested page (the last 20 pages). When there is more than one, a list next to the findings heading switches between them: *Whole application*, or a page with its application, such as */Orders (Web)*.

Within each, the *Codebase* and *Runtime* findings are kept apart: a *Codebase* test replaces only the code findings and keeps the running applications' findings, and the other way round. The heading then shows when each was tested, and *Found in* filters the list to the findings from the *Code* or from the *Running app*. The code and the running applications' findings are matched to each other only by a test that runs both.

- *View Results* opens the results in a tab of their own.
- *Export Results* saves them as Markdown or JSON.
- *Clear Results* deletes them.
- *Clear Results* deletes the results shown, of the whole application or of the page.

Each test also shows what it covered, and checks the findings of the AI a second time before reporting them; see [UI/UX Test](ui-ux-test.md#coverage) and [Security Test](security-test.md#findings). Few findings with a large coverage mean the application looks good; few findings with a small coverage mean the test could not reach much of it.

Expand Down
7 changes: 6 additions & 1 deletion docs/en/studio/running-applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ You can see the context menu by right-clicking *Folder*. It will start/stop all

### C# Application

The .NET icon indicates that the application is a C# project. After we [add](#c-application) the C# applications to the root of the tree or folder, we can go to any C# application and right-click to view the context menu; `Start`, `Stop`, `Restart`, `Build`, `Browse`, `Health Status`, `Requests`, `Exceptions`, `Logs`, `Copy URL`, `Properties`, `Remove`, and `Open with`.
The .NET icon indicates that the application is a C# project. After we [add](#c-application) the C# applications to the root of the tree or folder, we can go to any C# application and right-click to view the context menu; `Start`, `Stop`, `Restart`, `Build`, `Browse`, `AI Testing`, `Health Status`, `Requests`, `Exceptions`, `Logs`, `Copy URL`, `Properties`, `Remove`, and `Open with`.

![csharp-application-context-menu](images/solution-runner/csharp-application-context-menu.png)

Expand Down Expand Up @@ -222,6 +222,10 @@ When the C# application is connected to ABP Studio, it starts sending telemetry
- `Events`: Opens the *Events* tab filtered by this application. You can view all [Distributed Events](../framework/infrastructure/event-bus/distributed) sent or received by this application.
- `Logs`: Clicking this option opens the *Logs* tab with adding the selected application filter.

#### AI Testing

The *AI Testing* submenu tests one page of the application with *Test a Page (UI/UX)...* or *Test a Page (Security)...*. It opens the [UI/UX Test](ui-ux-test.md) or the [Security Test](security-test.md) with this application chosen, and asks for the page to test; see [Testing a Page](ai-testing.md#testing-a-page). These options are only available while the application is running.

#### Properties

We can open the *Application Properties* window to change *Launch url*, *Health check endpoints*, *Kubernetes service* and *run* information. To access the *Application Properties* window, navigate to a C# application, right-click to view the context menu, and select the Properties option.
Expand Down Expand Up @@ -268,6 +272,7 @@ CLI applications uses the [powershell](https://learn.microsoft.com/en-us/powersh

- `Start`: Starts the application. Once it is started, *Start* and *Restart* options will be available.
- `Browse`: This option is available when a *Launch URL* is specified upon adding the CLI application. It opens the *Browse* tab, can be clicked while the application is running.
- `AI Testing`: Tests one page of the running application, as for a [C# application](#ai-testing).
- `Logs`: It opens the *Logs* tab, we can see the logs for *Start* and *Stop* commands.
- `Copy URL`: This option copies the *Launch URL* of the selected application. It is visible if there is a specified *Launch URL*
- `Remove`: This option allows you to delete the selected application.
Expand Down
14 changes: 13 additions & 1 deletion docs/en/studio/security-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ The test crawls the applications' pages in a browser, finds their HTTP API endpo

For a single-page application (such as Angular) whose API takes a bearer token instead of a cookie, the test uses the token the application received at sign-in, and renews it before it expires.

A single-page application (such as React or Angular) calls its API in another application, its API host. Each ticked application is attacked on its own address, so tick the API host under *Apps to Test* too. If a ticked application may call its API in a running application that is not ticked, *Start Test* asks first: *Include the API apps too?* offers to *Select them and start*, or to *Start as selected*. Without the API host, its API is tested only through the pages of the application that calls it, and a warning says so when the test sees it.

### Verification

A separate AI agent checks each finding again, against the code and the running applications, and tries to reproduce it. The verification uses the session the test already signed in with, so it does not sign in again for each finding.
Expand All @@ -52,11 +54,21 @@ A separate AI agent checks each finding again, against the code and the running

Findings the verification proves false are removed.

## Testing a Page

When the test covers [a single page](ai-testing.md#testing-a-page), the attack stays on that page:

- *Find Scope* lists the page's *API calls*: every action of each controller the page's files use, as the application's API description lists them. The calls the page makes while it is tested are added as the test goes.
- The test sends requests only to the page, to its API calls (with any id and any method) and to what signing in needs. Other requests are refused, and the browser does not act on other pages. The check for exposed files (such as `.env` or `.git`) is left to the test of the whole application.
- The code review covers only the page's files.

When the page calls its API in another running application (a React or Angular page and its API host), the test sends its requests there; the dialog says *The page calls its API at …*. The API host is found from the running applications' API descriptions, or from the calls the page makes in the browser. Only an application of the solution that is running is attacked, never another service the page calls (such as an error tracker). The page's findings are verified against both applications.

## Findings

The findings are listed with the most severe first; filter them with *Severity* and *Status*. Each finding shows its severity and CWE, a description, how it can be reached (anonymously or with a signed-in account), the attack path and the remediation.

A finding of the code review shows its file and line, and opens it in the editor; a finding of the attack on a running application shows the request it was found with. *Checked against* names the application it was verified on.
A finding of the code review shows its file and line, and opens it in the editor; a finding of the attack on a running application shows the request it was found with. *Checked against* names the application it was verified on; for a page whose API runs in another application, both.

*Runtime Test Statistics* shows the pages crawled, the endpoints probed and the account the test was signed in with. *Export Results* can also save the findings as SARIF, for code scanning tools such as GitHub code scanning.

Expand Down
9 changes: 9 additions & 0 deletions docs/en/studio/ui-ux-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ The parts every page shares, such as the main menu, the header and the footer, a

With *Incremental* on, only the code review is limited to the changed files; the localization comparison always covers every language file.

## Testing a Page

When the test covers [a single page](ai-testing.md#testing-a-page), it works the same way on that page alone:

- It signs in and opens only that page; it does not follow its links to other pages. The links in the page's main content are still checked for being broken, up to 30, without testing the pages they open.
- The checks without AI, the AI review and the AI interaction look at the page's main content (its `main` element, or the element with the `main` role), not at the menu, the header and the footer every page shares. Those are tested with the whole application.
- The second pass that compares the pages for consistency is skipped, as there is one page.
- The code review covers only the page's files.

## Two Test Accounts

With a second test account, the applications are checked again as that account. Every page it reaches gets the checks without AI; only the pages the first account did not see get the AI review and interaction. A finding shows *Seen as* with the accounts that saw it, and re-verification signs in with that account.
Expand Down
Loading