Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2281a8729b | ||
|
|
e3c2c0cebb | ||
|
|
daecf3d539 | ||
|
|
71259bc11d | ||
|
|
d085ea3ded | ||
|
|
1273491eee | ||
|
|
6cba785e2f | ||
|
|
5152fffe82 | ||
|
|
9df8a652dc | ||
|
|
e577ee8683 | ||
|
|
0e998333e0 | ||
|
|
2840df68b2 | ||
|
|
0341fc2201 |
No files matched your search
+50
-18
@@ -1,7 +1,9 @@
|
||||
# Code quality checks on master and pull requests. On a push to master that
|
||||
# changes the version in the root package.json, also builds the Docker image
|
||||
# and pushes it to this Gitea instance's container registry, tagged with that
|
||||
# version and `latest`.
|
||||
# Code quality checks on master and pull requests. The server and client jobs
|
||||
# only run when their directory (or shared root files) changed. On a push to
|
||||
# master, also builds the Docker image and pushes it to this Gitea instance's
|
||||
# container registry, tagged with the root package.json version and `latest`
|
||||
# - unless that version's image already exists in the registry, in which case
|
||||
# the push is skipped.
|
||||
#
|
||||
# Needs a repository (or owner) secret REGISTRY_TOKEN: a Gitea access token
|
||||
# with package write access for the repository owner. The registry host is
|
||||
@@ -19,7 +21,31 @@ env:
|
||||
REGISTRY: git.hq.ars9.space
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
server: ${{ steps.filter.outputs.server }}
|
||||
client: ${{ steps.filter.outputs.client }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
server:
|
||||
- 'server/**'
|
||||
- 'package.json'
|
||||
- 'package-lock.json'
|
||||
- '.gitea/workflows/ci.yml'
|
||||
client:
|
||||
- 'client/**'
|
||||
- 'package.json'
|
||||
- 'package-lock.json'
|
||||
- '.gitea/workflows/ci.yml'
|
||||
|
||||
server:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.server == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -38,6 +64,8 @@ jobs:
|
||||
run: npm run -w server build
|
||||
|
||||
client:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.client == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -55,7 +83,7 @@ jobs:
|
||||
- name: Storybook tests
|
||||
run: npm run -w client test:storybook
|
||||
|
||||
# Compares the root package.json version with the one before the push
|
||||
# Skips the image job if the registry already has this version's image
|
||||
version:
|
||||
if: github.event_name == 'push'
|
||||
runs-on: ubuntu-latest
|
||||
@@ -64,28 +92,32 @@ jobs:
|
||||
changed: ${{ steps.check.outputs.changed }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- id: check
|
||||
env:
|
||||
BEFORE: ${{ github.event.before }}
|
||||
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||
OWNER: ${{ github.repository_owner }}
|
||||
run: |
|
||||
version=$(node -p "require('./package.json').version")
|
||||
previous=""
|
||||
if git cat-file -e "${BEFORE}^{commit}" 2>/dev/null; then
|
||||
previous=$(git show "${BEFORE}:package.json" | node -p "JSON.parse(require('fs').readFileSync(0, 'utf8')).version")
|
||||
fi
|
||||
echo "version: ${previous:-none} -> ${version}"
|
||||
echo "version=${version}" >> "$GITHUB_OUTPUT"
|
||||
if [ "$version" != "$previous" ]; then
|
||||
echo "changed=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
image="${REGISTRY}/$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]')"
|
||||
echo "$REGISTRY_TOKEN" | docker login "$REGISTRY" -u "$OWNER" --password-stdin
|
||||
if docker manifest inspect "${image}:${version}" >/dev/null 2>&1; then
|
||||
echo "version ${version}: image already in registry, skipping"
|
||||
echo "changed=false" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "version ${version}: not in registry, building"
|
||||
echo "changed=true" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
echo "version=${version}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
image:
|
||||
needs: [server, client, version]
|
||||
if: needs.version.outputs.changed == 'true'
|
||||
# server/client may be skipped when their paths didn't change
|
||||
if: |
|
||||
!failure() && !cancelled() &&
|
||||
github.event_name == 'push' &&
|
||||
needs.version.outputs.changed == 'true' &&
|
||||
(needs.server.result == 'success' || needs.server.result == 'skipped') &&
|
||||
(needs.client.result == 'success' || needs.client.result == 'skipped')
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
VERSION: ${{ needs.version.outputs.version }}
|
||||
|
||||
@@ -2,6 +2,29 @@
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## 1.24.0 - 2026-10-01
|
||||
|
||||
Changes since 1.23.0:
|
||||
|
||||
### Added
|
||||
|
||||
- Code reference in the UI: a (?) button next to the Code label on the step and snippet create/edit pages opens a modal documenting the script runtime - the globals (`context`, `expect`, `console`, and `args` in snippets) and every `context` member with examples, including pitfalls such as awaiting `getStepOutput()` and `assert()`, and `downloadFile()` not sending the browser's cookies.
|
||||
|
||||
### Changed
|
||||
|
||||
- `Modal` UI component: new `size="lg"` for long, document-like content. Dialogs are now capped to the viewport height and their body scrolls, instead of overflowing the screen.
|
||||
|
||||
## 1.23.0 - 2026-10-01
|
||||
|
||||
Changes since 1.22.2:
|
||||
|
||||
### Added
|
||||
|
||||
- Run log entries now carry a `context` (where the message was generated: `step:<N>`, `snippet:<alias>`, `assertion:pass`/`fail`, or `run`) and a `data` field: `context.log`/`warn`/`error` and `console.*` split their arguments so strings join into `message` while object/array arguments are kept separate as `data` (JSON), instead of being `JSON.stringify`'d into the message text.
|
||||
- Added a `debug` log level (`context.debug()`, `console.debug()`), alongside `log`/`warn`/`error`.
|
||||
- New `LogOutput` UI component: a terminal-style log viewer on the run detail page, color-coded by level, with an elapsed-time-since-start column, a context tag, and `data` rendered pretty-printed in a separate block below the message. The full log list is shown (no more pagination), capped to a scrollable block.
|
||||
- Run log CSV/Markdown export (`GET /scenarios/:id/runs/:runId/export`) include the new `context` and `data` columns/blocks; the logs search (`?q=`) also matches `context`.
|
||||
|
||||
## 1.22.2 - 2026-10-01
|
||||
|
||||
Changes since 1.22.1:
|
||||
|
||||
@@ -26,6 +26,10 @@ Rebuild and restart: `docker compose up -d --build`. Check with `docker compose
|
||||
|
||||
The live database is `data/liqa.db`. The container applies pending migrations before starting the server, so back it up before deploying a release with new migrations.
|
||||
|
||||
## Branching
|
||||
|
||||
Never commit directly to `master` when implementing a feature, chore or bug fix: create a separate branch for the work first. Only version-bump release commits (see "Committing a new version") are made on `master`.
|
||||
|
||||
## Code quality
|
||||
|
||||
Before committing, run and pass all of these (and report the results):
|
||||
@@ -53,4 +57,13 @@ When asked to commit:
|
||||
4. Add a `## <version> - <YYYY-MM-DD>` entry at the top of `CHANGELOG.md` ("Changes since <previous version>:", then `### Added` / `### Changed` / `### Fixed`). Mark breaking changes with **Breaking:**.
|
||||
5. Update the docs affected by the change (`docs/*.md`, `README.md`, `.env.example`, MCP tool descriptions).
|
||||
6. Build the commit message with the `/git-commit` skill if it is available, following its format and rules. Otherwise use a conventional commit message (`type(scope): subject`, then a bullet list body). Either way, put the version bump in the body as a bullet (e.g. `- bump version to <version>`), not in the subject line. This overrides the skill's rule of putting versions in the subject. Then make the commit with that message.
|
||||
7. **After committing, ask the user whether to rebuild and restart the docker compose containers** (`docker compose up -d --build`); don't do it without confirmation.
|
||||
7. **Tag the version commit** with an annotated tag `v<version>` whose message is that version's `CHANGELOG.md` entry, verbatim (from its `## <version>` heading up to the next version's heading). Commits without a version bump get no tag. `--cleanup=whitespace` is required: the default cleanup strips lines starting with `#`, which would drop the entry's headings:
|
||||
|
||||
```bash
|
||||
v=<version>
|
||||
awk -v v="$v" 'index($0, "## " v " ") == 1 {p = 1; print; next} p && /^## / {exit} p' CHANGELOG.md \
|
||||
| git tag -a "v$v" --cleanup=whitespace -F -
|
||||
```
|
||||
|
||||
Don't push the tag; tell the user to push with `git push --follow-tags`, which also pushes annotated tags.
|
||||
8. **After committing, ask the user whether to rebuild and restart the docker compose containers** (`docker compose up -d --build`); don't do it without confirmation.
|
||||
@@ -16,6 +16,18 @@ Everything is served from one container at **http://localhost:13000**: the UI at
|
||||
|
||||
---
|
||||
|
||||
## Installation
|
||||
|
||||
To install liqa from the published image, without cloning this repo:
|
||||
|
||||
```bash
|
||||
curl -fsSL https://git.hq.ars9.space/ars9/liqa/raw/branch/master/scripts/install.sh | bash
|
||||
```
|
||||
|
||||
This asks for an install directory, a port and a version (latest by default), then writes a `compose.yaml` and a `data/` directory there. Start it with `docker compose up -d` in that directory.
|
||||
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
| Concept | Description |
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react-vite';
|
||||
import { LogOutput } from '../../src/ui/LogOutput/LogOutput';
|
||||
|
||||
const meta: Meta<typeof LogOutput> = {
|
||||
title: 'UI/LogOutput',
|
||||
component: LogOutput,
|
||||
tags: ['autodocs'],
|
||||
parameters: { layout: 'padded' },
|
||||
};
|
||||
export default meta;
|
||||
|
||||
type Story = StoryObj<typeof LogOutput>;
|
||||
|
||||
const secondsAgo = (n: number) => new Date(Date.now() - n * 1000).toISOString();
|
||||
|
||||
export const Default: Story = {
|
||||
args: {
|
||||
startTime: secondsAgo(60),
|
||||
entries: [
|
||||
{
|
||||
id: 0,
|
||||
level: 'debug',
|
||||
context: 'step:1',
|
||||
message: 'Resolved credential alias "sdJwtKey" to a file credential',
|
||||
createdAt: secondsAgo(61),
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
level: 'log',
|
||||
context: 'step:1',
|
||||
message: 'Step 1 started: Login with PKCS',
|
||||
createdAt: secondsAgo(60),
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
level: 'log',
|
||||
context: 'snippet:loginWithPkcs',
|
||||
message: 'Snippet "loginWithPkcs" started',
|
||||
createdAt: secondsAgo(58),
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
level: 'log',
|
||||
context: 'snippet:loginWithPkcs',
|
||||
message: 'Saved credential as run file:',
|
||||
data: JSON.stringify({
|
||||
id: '181d8ae2-4aee-4f33-a657-210efe7fe668',
|
||||
name: 'credential.sd-jwt',
|
||||
mimeType: 'application/octet-stream',
|
||||
size: 1657,
|
||||
sha256: '9c4226999c700a39bda30279907e4479a5b3920ccde5c75771ea0e264c638c0',
|
||||
path: 'data/files/18/181d/181d8ae2-4aee-4f33-a657-210efe7fe668',
|
||||
}),
|
||||
createdAt: secondsAgo(57),
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
level: 'log',
|
||||
context: 'snippet:loginWithPkcs',
|
||||
message: 'Navigating to ID login: https://id.example.com',
|
||||
createdAt: secondsAgo(57),
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
level: 'log',
|
||||
context: 'assertion:pass',
|
||||
message: 'Assertion passed: page must have redirected to cabinet URL',
|
||||
createdAt: secondsAgo(40),
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
level: 'warn',
|
||||
context: 'snippet:loginWithPkcs',
|
||||
message: 'Retrying file upload after a transient error',
|
||||
createdAt: secondsAgo(39),
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
level: 'log',
|
||||
context: 'step:1',
|
||||
message: 'Step 1 passed',
|
||||
createdAt: secondsAgo(30),
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
level: 'error',
|
||||
context: 'assertion:fail',
|
||||
message: 'Assertion failed: Document validation must pass (got 422)',
|
||||
createdAt: secondsAgo(10),
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
level: 'error',
|
||||
context: 'step:2',
|
||||
message: 'Step 2 failed: Document validation must pass (got 422)',
|
||||
createdAt: secondsAgo(9),
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const Scrollable: Story = {
|
||||
args: {
|
||||
maxHeight: 160,
|
||||
startTime: secondsAgo(60),
|
||||
entries: Array.from({ length: 30 }, (_, i) => ({
|
||||
id: i,
|
||||
level: (['log', 'log', 'log', 'warn', 'error'] as const)[i % 5],
|
||||
context: `step:${Math.floor(i / 6) + 1}`,
|
||||
message: `Log entry ${i + 1}`,
|
||||
createdAt: secondsAgo(60 - i * 2),
|
||||
})),
|
||||
},
|
||||
};
|
||||
|
||||
export const Empty: Story = {
|
||||
args: {
|
||||
entries: [],
|
||||
emptyMessage: 'No logs yet.',
|
||||
},
|
||||
};
|
||||
@@ -4,13 +4,22 @@ import { expect, userEvent, within } from 'storybook/test';
|
||||
import { Modal } from '../../src/ui/Modal/Modal';
|
||||
import { Button } from '../../src/ui/Button/Button';
|
||||
|
||||
function ModalDemo({ title, body }: { title: string; body: string }) {
|
||||
function ModalDemo({
|
||||
title,
|
||||
body,
|
||||
size,
|
||||
}: {
|
||||
title: string;
|
||||
body: React.ReactNode;
|
||||
size?: 'md' | 'lg';
|
||||
}) {
|
||||
const [open, setOpen] = useState(false);
|
||||
return (
|
||||
<>
|
||||
<Button onClick={() => setOpen(true)}>Open modal</Button>
|
||||
<Modal
|
||||
open={open}
|
||||
size={size}
|
||||
title={title}
|
||||
onClose={() => setOpen(false)}
|
||||
footer={
|
||||
@@ -61,3 +70,29 @@ export const ClosesOnEscapeAndBackdrop: Story = {
|
||||
await expect(canvas.queryByRole('dialog')).not.toBeInTheDocument();
|
||||
},
|
||||
};
|
||||
|
||||
export const Large: Story = {
|
||||
args: {
|
||||
title: 'Code reference',
|
||||
size: 'lg',
|
||||
body: (
|
||||
<>
|
||||
{Array.from({ length: 60 }, (_, i) => (
|
||||
<p key={i}>Paragraph {i + 1} of a long, document-like modal body.</p>
|
||||
))}
|
||||
</>
|
||||
),
|
||||
},
|
||||
play: async ({ canvasElement }) => {
|
||||
const canvas = within(canvasElement);
|
||||
await userEvent.click(canvas.getByRole('button', { name: 'Open modal' }));
|
||||
const dialog = canvas.getByRole('dialog', { name: 'Code reference' });
|
||||
// The dialog stays within the viewport; its body scrolls instead.
|
||||
await expect(dialog.getBoundingClientRect().height).toBeLessThanOrEqual(window.innerHeight);
|
||||
const body = within(dialog).getByText(
|
||||
'Paragraph 1 of a long, document-like modal body.',
|
||||
).parentElement!;
|
||||
await expect(body.scrollHeight).toBeGreaterThan(body.clientHeight);
|
||||
await expect(within(dialog).getByRole('button', { name: 'Confirm' })).toBeVisible();
|
||||
},
|
||||
};
|
||||
@@ -147,7 +147,7 @@ export interface RunDefaults {
|
||||
|
||||
export type RunStepStatus = 'waiting' | 'pending' | 'in_progress' | 'pass' | 'fail' | 'cancelled';
|
||||
|
||||
export type LogLevel = 'log' | 'warn' | 'error';
|
||||
export type LogLevel = 'debug' | 'log' | 'warn' | 'error';
|
||||
|
||||
export interface ScenarioRun {
|
||||
id: string;
|
||||
@@ -189,7 +189,11 @@ export interface ScenarioRunLog {
|
||||
runId: string;
|
||||
stepRunId: string | null;
|
||||
level: LogLevel;
|
||||
/** Where the message was generated, e.g. "step:2", "snippet:login", "assertion:pass". */
|
||||
context: string | null;
|
||||
message: string;
|
||||
/** JSON payload attached to the message (e.g. a created file's metadata), as a raw string. */
|
||||
data: string | null;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
.helpButton {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 2px;
|
||||
border: none;
|
||||
border-radius: var(--radius-sm);
|
||||
background: none;
|
||||
color: var(--color-text-muted);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.helpButton:hover {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.helpButton:focus-visible {
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35);
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
import { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { CircleHelp, X } from 'lucide-react';
|
||||
import { Modal, Button, MarkdownContent } from '../../ui';
|
||||
import content from './code-help.md?raw';
|
||||
import styles from './CodeHelpModal.module.css';
|
||||
|
||||
export interface CodeHelpModalProps {
|
||||
open: boolean;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
/** Reference for the script runtime (`context`, `expect`, ...) available to step and snippet code. */
|
||||
export function CodeHelpModal({ open, onClose }: CodeHelpModalProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
size="lg"
|
||||
title={t('code_help.title')}
|
||||
onClose={onClose}
|
||||
footer={
|
||||
<Button variant="secondary" onClick={onClose}>
|
||||
<X size={14} />
|
||||
{t('code_help.close')}
|
||||
</Button>
|
||||
}
|
||||
>
|
||||
<MarkdownContent content={content} />
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
/** A (?) button that opens the {@link CodeHelpModal}; place it next to a code field label. */
|
||||
export function CodeHelpButton() {
|
||||
const { t } = useTranslation();
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
type="button"
|
||||
className={styles.helpButton}
|
||||
onClick={() => setOpen(true)}
|
||||
aria-label={t('code_help.open')}
|
||||
title={t('code_help.open')}
|
||||
>
|
||||
<CircleHelp size={16} />
|
||||
</button>
|
||||
<CodeHelpModal open={open} onClose={() => setOpen(false)} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
Step code and snippet code are the **body of an async function**. Use `await` freely; whatever you `return` becomes the step (or snippet) output.
|
||||
|
||||
```js
|
||||
async (context) => {
|
||||
// your code here
|
||||
}
|
||||
```
|
||||
|
||||
All steps of a run share one browser, one browser context and one page, so state carries over from step to step: the current URL, cookies, local storage, open dialogs.
|
||||
|
||||
A step **passes** when its code returns, and **fails** when it throws or exceeds its timeout. When a step fails, the remaining steps are cancelled, and a screenshot and the page HTML are saved to the run's files.
|
||||
|
||||
## Globals
|
||||
|
||||
| Name | Description |
|
||||
| --- | --- |
|
||||
| `context` | The run context, described below. |
|
||||
| `expect` | Playwright's [`expect`](https://playwright.dev/docs/test-assertions), with auto-retrying web assertions. |
|
||||
| `console` | Writes to the run log: `log`/`info` → `log`, plus `warn`, `error` and `debug`. |
|
||||
| `args` | **Snippets only.** The extra arguments passed to `context.runSnippet(name, ...args)`. |
|
||||
|
||||
Code runs in the server process with Node.js. It is trusted code, not sandboxed.
|
||||
|
||||
## Browser
|
||||
|
||||
### `context.page`
|
||||
|
||||
The Playwright [`Page`](https://playwright.dev/docs/api/class-page) of the run.
|
||||
|
||||
```js
|
||||
await context.page.goto(context.getEnv("base_url"));
|
||||
await context.page.getByRole("button", { name: "Sign in" }).click();
|
||||
await expect(context.page.locator("h1")).toHaveText("Dashboard");
|
||||
```
|
||||
|
||||
### `context.browser`
|
||||
|
||||
The Playwright [`BrowserContext`](https://playwright.dev/docs/api/class-browsercontext) the page belongs to. Use it for cookies, storage state, extra pages and HTTP requests that share the browser's cookies.
|
||||
|
||||
```js
|
||||
const cookies = await context.browser.cookies();
|
||||
const res = await context.browser.request.get(context.getEnv("api_url") + "/me");
|
||||
```
|
||||
|
||||
### `context.dumpDom(selector?)` → `Promise<DomNode>`
|
||||
|
||||
Returns a simplified tree of the live DOM, starting at `selector` (default `"body"`). Decorative and layout elements are filtered out. The tree keeps landmarks, interactive elements, and elements with `role`, `data-testid`, `data-qa`, `data-action` or `data-element-id`. Each node has `tag` and `children`, plus `role`, `testid`, `id`, `name`, `type`, `text`, `href`, `checked`, `disabled`, etc. when they are present. This is useful for finding selectors without a screenshot.
|
||||
|
||||
If nothing matches `selector`, it returns a node with `tag: "ERROR"` instead of throwing.
|
||||
|
||||
```js
|
||||
context.log("Login form:", await context.dumpDom("form"));
|
||||
```
|
||||
|
||||
## Environment
|
||||
|
||||
### `context.env`
|
||||
|
||||
A copy of the selected environment's key/value map, `{}` when there is none. A missing key reads as `undefined`.
|
||||
|
||||
### `context.getEnv(key)` → `string`
|
||||
|
||||
Returns the environment value for `key`, and **throws** if it is not defined. Prefer it over `context.env[key]` for required settings: the step then fails with a clear message.
|
||||
|
||||
```js
|
||||
const baseUrl = context.getEnv("base_url");
|
||||
const locale = context.env.locale ?? "en";
|
||||
```
|
||||
|
||||
## Credentials
|
||||
|
||||
### `context.getCredential(alias)` → `unknown`
|
||||
|
||||
Returns the payload of the credential assigned to this scenario under `alias` (see **Credentials** on the scenario page). JSON data is returned parsed, anything else as a string. **Throws** if no credential has that alias.
|
||||
|
||||
```js
|
||||
const { username, password } = context.getCredential("admin");
|
||||
await context.page.getByLabel("Username").fill(username);
|
||||
await context.page.getByLabel("Password").fill(password);
|
||||
```
|
||||
|
||||
## Step outputs
|
||||
|
||||
### `context.getStepOutput(order)` → `Promise<unknown>`
|
||||
|
||||
Returns the output (the return value) of another step in the same run. **It is async, so `await` it.**
|
||||
|
||||
- A positive `order` is absolute: `1` is the first step.
|
||||
- A negative `order` is relative: `-1` is the previous step.
|
||||
|
||||
Returns `null` if that step does not exist, has not run, or returned nothing. A step's output is stored as JSON, so only JSON-serializable values come back as they were returned (no functions, `Date` becomes a string, Playwright objects are not usable).
|
||||
|
||||
```js
|
||||
// step 2
|
||||
return { orderId: await context.page.locator("#order-id").textContent() };
|
||||
|
||||
// step 3
|
||||
const { orderId } = await context.getStepOutput(-1);
|
||||
```
|
||||
|
||||
## Logging
|
||||
|
||||
### `context.log(...args)`, `context.warn(...args)`, `context.error(...args)`, `context.debug(...args)`
|
||||
|
||||
Write an entry with that level to the run log. `console.*` does the same. Strings, numbers and booleans are joined with spaces into the message. Objects and arrays are kept separate as structured **data**, shown pretty-printed under the message: one object is stored as is, several are stored as an array.
|
||||
|
||||
```js
|
||||
context.log("Created user", user.id, user); // message "Created user 42", data = user
|
||||
```
|
||||
|
||||
Every entry is tagged with where it came from: `step:<N>`, or `snippet:<alias>` while a snippet runs.
|
||||
|
||||
## Assertions
|
||||
|
||||
### `context.assert(fn, description)` → `Promise<void>`
|
||||
|
||||
Runs `fn` (sync or async) and requires it to return exactly `true`.
|
||||
|
||||
- On success, it logs `description` (tagged `assertion:pass`).
|
||||
- If `fn` returns anything else or throws, it logs `Assertion failed: <description>` as an error (tagged `assertion:fail`) and throws, which fails the step.
|
||||
|
||||
Await it, or a failure will not stop the step.
|
||||
|
||||
```js
|
||||
await context.assert(
|
||||
async () => (await context.page.locator(".cart-item").count()) === 3,
|
||||
"Cart contains 3 items",
|
||||
);
|
||||
```
|
||||
|
||||
Use `expect` instead for assertions that wait and retry until the page matches, e.g. `await expect(locator).toBeVisible()`.
|
||||
|
||||
## Snippets
|
||||
|
||||
### `context.runSnippet(name, ...args)` → `Promise<unknown>`
|
||||
|
||||
Runs a stored snippet with the same `context` (same page, environment and credentials) and returns the snippet's return value. Extra arguments are available inside the snippet as `args`.
|
||||
|
||||
- `name` is the snippet alias, which runs its latest version.
|
||||
- `alias@<version>` (e.g. `login@3`) pins a specific version.
|
||||
|
||||
Start, finish and failure are logged. If the snippet throws, the error propagates and fails the calling step unless you catch it. Snippets can call other snippets.
|
||||
|
||||
```js
|
||||
// step code
|
||||
const user = await context.runSnippet("login", "admin", { remember: true });
|
||||
|
||||
// snippet "login"
|
||||
const [alias, opts] = args;
|
||||
const { username, password } = context.getCredential(alias);
|
||||
// ...
|
||||
return { username };
|
||||
```
|
||||
|
||||
## Files
|
||||
|
||||
### `context.getScenarioFiles(opts?)` → `Promise<{ items, total }>`
|
||||
|
||||
Lists the files uploaded to this scenario (see **Files** on the scenario page). `opts` takes `limit` and `offset` for paging. Each item has `id`, `name`, `mimeType`, `size`, `sha256` and `path`, the absolute path on the server's disk, which you can pass to Playwright:
|
||||
|
||||
```js
|
||||
const { items } = await context.getScenarioFiles();
|
||||
const doc = items.find((f) => f.name === "contract.pdf");
|
||||
await context.page.locator("input[type=file]").setInputFiles(doc.path);
|
||||
```
|
||||
|
||||
### `context.downloadFile(url, opts?)` → `Promise<FileInfo>`
|
||||
|
||||
Fetches `url` on the server and saves the response as a file of the current run. It returns the same fields as a scenario file (`id`, `name`, `mimeType`, `size`, `sha256`, `path`).
|
||||
|
||||
- `opts`: `method`, `headers`, `body` (a string) and `filename`. Without `filename`, the last segment of the URL path is used, and the MIME type is derived from the file extension.
|
||||
- Redirects are followed. Any final status other than 200 throws. The limits are 100 MB and a 30 s timeout.
|
||||
- `url` may be a `data:` URI (`data:<type>;base64,<data>` or `data:<type>,<percent-encoded>`), which saves content generated in the script without a network request. Pass `filename` in this case.
|
||||
- Only works during a real scenario run. It throws in ad-hoc execution such as the `exec_code` MCP tool.
|
||||
- This is a server-side request: it does **not** send the browser's cookies. Pass them in `headers` if the URL needs a session.
|
||||
|
||||
```js
|
||||
await context.downloadFile(
|
||||
"data:application/json;base64," + btoa(JSON.stringify(report)),
|
||||
{ filename: "report.json" },
|
||||
);
|
||||
```
|
||||
|
||||
## Timeouts
|
||||
|
||||
Each step has its own timeout, or else the scenario's timeout, or else 60 s. The whole run fails once it exceeds the scenario's timeout (600 s by default). That check happens between steps.
|
||||
@@ -6,3 +6,5 @@ export { RunScenarioModal } from './RunScenarioModal';
|
||||
export type { RunScenarioModalProps } from './RunScenarioModal';
|
||||
export { ExportLogsModal } from './ExportLogsModal';
|
||||
export type { ExportLogsModalProps, LogExportFormat } from './ExportLogsModal';
|
||||
export { CodeHelpModal, CodeHelpButton } from './CodeHelpModal';
|
||||
export type { CodeHelpModalProps } from './CodeHelpModal';
|
||||
@@ -12,6 +12,11 @@
|
||||
"confirm_remove_credential": "Are you sure you want to remove this credential from scenario?",
|
||||
"save_session": "Save session"
|
||||
},
|
||||
"code_help": {
|
||||
"open": "Code reference",
|
||||
"title": "Code reference",
|
||||
"close": "Close"
|
||||
},
|
||||
"errors": {
|
||||
"not_found": "Not found",
|
||||
"not_found_session": "Session {{id}} does not exist or has been deleted.",
|
||||
|
||||
@@ -255,6 +255,12 @@
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.labelRow {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.textarea {
|
||||
width: 100%;
|
||||
padding: var(--space-2) var(--space-3);
|
||||
|
||||
@@ -7,10 +7,8 @@ import type {
|
||||
Scenario,
|
||||
ScenarioRunDetail,
|
||||
ScenarioRunStep,
|
||||
ScenarioRunLog,
|
||||
ScenarioRunStatus,
|
||||
RunStepStatus,
|
||||
LogLevel,
|
||||
FileMetadata,
|
||||
} from '../../api';
|
||||
import { scenarios } from '../../api';
|
||||
@@ -27,7 +25,7 @@ import {
|
||||
Card,
|
||||
CodeBlock,
|
||||
DescriptionList,
|
||||
Pagination,
|
||||
LogOutput,
|
||||
Search,
|
||||
Table,
|
||||
Timestamp,
|
||||
@@ -70,12 +68,6 @@ const STEP_STATUS_VARIANT: Record<RunStepStatus, BadgeVariant> = {
|
||||
cancelled: 'warning',
|
||||
};
|
||||
|
||||
const LOG_LEVEL_VARIANT: Record<LogLevel, BadgeVariant> = {
|
||||
log: 'neutral',
|
||||
warn: 'warning',
|
||||
error: 'error',
|
||||
};
|
||||
|
||||
const FINAL: ScenarioRunStatus[] = ['pass', 'fail'];
|
||||
|
||||
export function RunDetailPage() {
|
||||
@@ -97,7 +89,6 @@ function RunDetail() {
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [polling, setPolling] = useState(false);
|
||||
const [pulseKey, setPulseKey] = useState(0);
|
||||
const [logPage, setLogPage] = useState(1);
|
||||
const [logSearch, setLogSearch] = useState('');
|
||||
const [debouncedSearch, setDebouncedSearch] = useState('');
|
||||
const [expandAll, setExpandAll] = useState(false);
|
||||
@@ -112,7 +103,6 @@ function RunDetail() {
|
||||
const [deletingFile, setDeletingFile] = useState(false);
|
||||
const [repeating, setRepeating] = useState(false);
|
||||
const logSearchRef = useRef('');
|
||||
const LOG_PAGE_SIZE = 25;
|
||||
const pollRef = useRef<ReturnType<typeof setInterval> | null>(null);
|
||||
|
||||
const stopPolling = () => {
|
||||
@@ -221,7 +211,6 @@ function RunDetail() {
|
||||
const t = setTimeout(() => {
|
||||
setDebouncedSearch(logSearch);
|
||||
logSearchRef.current = logSearch;
|
||||
setLogPage(1);
|
||||
}, 300);
|
||||
return () => clearTimeout(t);
|
||||
}, [logSearch]);
|
||||
@@ -400,26 +389,6 @@ function RunDetail() {
|
||||
},
|
||||
];
|
||||
|
||||
const logColumns: TableColumn<ScenarioRunLog>[] = [
|
||||
{
|
||||
key: 'level',
|
||||
header: t('runs.log_level'),
|
||||
width: 70,
|
||||
render: (l) => <Badge variant={LOG_LEVEL_VARIANT[l.level]}>{l.level}</Badge>,
|
||||
},
|
||||
{
|
||||
key: 'message',
|
||||
header: t('runs.log_message'),
|
||||
render: (l) => <code style={{ wordBreak: 'break-word' }}>{l.message}</code>,
|
||||
},
|
||||
{
|
||||
key: 'time',
|
||||
header: t('runs.log_time'),
|
||||
width: 160,
|
||||
render: (l) => <Timestamp value={l.createdAt} />,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className={styles.pageToolbar}>
|
||||
@@ -560,21 +529,19 @@ function RunDetail() {
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<Table
|
||||
columns={logColumns}
|
||||
data={run.logs.slice((logPage - 1) * LOG_PAGE_SIZE, logPage * LOG_PAGE_SIZE)}
|
||||
rowKey={(l) => l.id}
|
||||
loading={false}
|
||||
<LogOutput
|
||||
startTime={run.createdAt}
|
||||
maxHeight={480}
|
||||
entries={run.logs.map((l) => ({
|
||||
id: l.id,
|
||||
level: l.level,
|
||||
context: l.context,
|
||||
message: l.message,
|
||||
data: l.data,
|
||||
createdAt: l.createdAt,
|
||||
}))}
|
||||
emptyMessage=""
|
||||
/>
|
||||
{run.logs.length > LOG_PAGE_SIZE && (
|
||||
<Pagination
|
||||
page={logPage}
|
||||
pageSize={LOG_PAGE_SIZE}
|
||||
total={run.logs.length}
|
||||
onPageChange={setLogPage}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import { X, Save, ClipboardList } from 'lucide-react';
|
||||
import { scenarios, steps } from '../../api';
|
||||
import type { Scenario } from '../../api';
|
||||
import { Breadcrumbs, Button, Card, Input, CodeEditor, useToast } from '../../ui';
|
||||
import { CodeHelpButton } from '../../components/modals';
|
||||
import styles from '../Page.module.css';
|
||||
|
||||
export function CreateStepPage() {
|
||||
@@ -77,7 +78,10 @@ export function CreateStepPage() {
|
||||
onChange={(e) => setTitle(e.target.value)}
|
||||
/>
|
||||
<div className={styles.formField}>
|
||||
<label className={styles.fieldLabel}>{t('steps.form_exec_code')}</label>
|
||||
<div className={styles.labelRow}>
|
||||
<label className={styles.fieldLabel}>{t('steps.form_exec_code')}</label>
|
||||
<CodeHelpButton />
|
||||
</div>
|
||||
<CodeEditor value={execCode} onChange={setExecCode} rows={6} />
|
||||
</div>
|
||||
<Input
|
||||
|
||||
@@ -6,6 +6,7 @@ import { X, Save, ClipboardList } from 'lucide-react';
|
||||
import { scenarios, steps } from '../../api';
|
||||
import type { Scenario, ScenarioStep } from '../../api';
|
||||
import { Breadcrumbs, Button, Card, Input, CodeEditor, useToast } from '../../ui';
|
||||
import { CodeHelpButton } from '../../components/modals';
|
||||
import styles from '../Page.module.css';
|
||||
|
||||
export function EditStepPage() {
|
||||
@@ -89,7 +90,10 @@ export function EditStepPage() {
|
||||
onChange={(e) => setTitle(e.target.value)}
|
||||
/>
|
||||
<div className={styles.formField}>
|
||||
<label className={styles.fieldLabel}>{t('steps.form_exec_code')}</label>
|
||||
<div className={styles.labelRow}>
|
||||
<label className={styles.fieldLabel}>{t('steps.form_exec_code')}</label>
|
||||
<CodeHelpButton />
|
||||
</div>
|
||||
<CodeEditor value={execCode} onChange={setExecCode} rows={6} />
|
||||
</div>
|
||||
<Input
|
||||
|
||||
@@ -5,6 +5,7 @@ import { usePageTitle } from '../../hooks/usePageTitle';
|
||||
import { X, Save, Braces } from 'lucide-react';
|
||||
import { snippets } from '../../api';
|
||||
import { Breadcrumbs, Button, Card, Input, CodeEditor, useToast } from '../../ui';
|
||||
import { CodeHelpButton } from '../../components/modals';
|
||||
import styles from '../Page.module.css';
|
||||
|
||||
export function CreateSnippetPage() {
|
||||
@@ -107,10 +108,13 @@ export function CreateSnippetPage() {
|
||||
/>
|
||||
</div>
|
||||
<div className={styles.formField}>
|
||||
<label className={styles.fieldLabel}>
|
||||
{t('snippets.form_code')}
|
||||
<span className={styles.requiredMark}> *</span>
|
||||
</label>
|
||||
<div className={styles.labelRow}>
|
||||
<label className={styles.fieldLabel}>
|
||||
{t('snippets.form_code')}
|
||||
<span className={styles.requiredMark}> *</span>
|
||||
</label>
|
||||
<CodeHelpButton />
|
||||
</div>
|
||||
<CodeEditor
|
||||
value={code}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -6,6 +6,7 @@ import { X, Save, Braces } from 'lucide-react';
|
||||
import { snippets } from '../../api';
|
||||
import type { Snippet } from '../../api';
|
||||
import { Breadcrumbs, Button, Card, Input, CodeEditor, useToast } from '../../ui';
|
||||
import { CodeHelpButton } from '../../components/modals';
|
||||
import styles from '../Page.module.css';
|
||||
|
||||
export function EditSnippetPage() {
|
||||
@@ -134,10 +135,13 @@ export function EditSnippetPage() {
|
||||
/>
|
||||
</div>
|
||||
<div className={styles.formField}>
|
||||
<label className={styles.fieldLabel}>
|
||||
{t('snippets.form_code')}
|
||||
<span className={styles.requiredMark}> *</span>
|
||||
</label>
|
||||
<div className={styles.labelRow}>
|
||||
<label className={styles.fieldLabel}>
|
||||
{t('snippets.form_code')}
|
||||
<span className={styles.requiredMark}> *</span>
|
||||
</label>
|
||||
<CodeHelpButton />
|
||||
</div>
|
||||
<CodeEditor
|
||||
value={code}
|
||||
onChange={(v) => {
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
.root {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--color-bg-subtle);
|
||||
border: var(--border-width) solid var(--color-border);
|
||||
border-radius: var(--radius-md);
|
||||
overflow: auto;
|
||||
font-family: var(--font-mono, ui-monospace, 'Cascadia Code', 'Fira Code', monospace);
|
||||
font-size: var(--font-size-xs);
|
||||
}
|
||||
|
||||
.empty {
|
||||
padding: var(--space-4);
|
||||
color: var(--color-text-muted);
|
||||
font-size: var(--font-size-sm);
|
||||
}
|
||||
|
||||
.line {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1) var(--space-3);
|
||||
border-left: 3px solid transparent;
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
.line:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.lineHeader {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.data {
|
||||
margin: 0 0 var(--space-1) calc(7em + var(--space-2));
|
||||
border: var(--border-width) solid var(--color-border);
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--color-bg);
|
||||
max-width: 100%;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.data > * {
|
||||
margin: 0;
|
||||
padding: var(--space-2) var(--space-3);
|
||||
}
|
||||
|
||||
.timestamp {
|
||||
flex: 0 0 auto;
|
||||
min-width: 7em;
|
||||
text-align: right;
|
||||
color: var(--color-text-muted);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.level {
|
||||
flex: 0 0 auto;
|
||||
width: 4.5em;
|
||||
text-transform: uppercase;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.context {
|
||||
flex: 0 0 auto;
|
||||
color: var(--color-secondary-fg);
|
||||
}
|
||||
|
||||
.context::before {
|
||||
content: '[';
|
||||
}
|
||||
|
||||
.context::after {
|
||||
content: ']';
|
||||
}
|
||||
|
||||
.message {
|
||||
flex: 1 1 320px;
|
||||
color: var(--color-text);
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.debug {
|
||||
border-left-color: var(--color-border);
|
||||
}
|
||||
|
||||
.debug .level,
|
||||
.debug .message,
|
||||
.debug .timestamp,
|
||||
.debug .context {
|
||||
color: var(--color-text-faint);
|
||||
}
|
||||
|
||||
.log {
|
||||
border-left-color: var(--color-border);
|
||||
}
|
||||
|
||||
.log .level {
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
.warn {
|
||||
border-left-color: var(--color-warning-fg);
|
||||
background: var(--color-warning-bg);
|
||||
}
|
||||
|
||||
.warn .level {
|
||||
color: var(--color-warning-fg);
|
||||
}
|
||||
|
||||
.error {
|
||||
border-left-color: var(--color-error-fg);
|
||||
background: var(--color-error-bg);
|
||||
}
|
||||
|
||||
.error .level {
|
||||
color: var(--color-error-fg);
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
import { CodeBlock } from '../CodeBlock/CodeBlock';
|
||||
import styles from './LogOutput.module.css';
|
||||
|
||||
export type LogOutputLevel = 'debug' | 'log' | 'warn' | 'error';
|
||||
|
||||
export interface LogOutputEntry {
|
||||
id: string | number;
|
||||
level: LogOutputLevel;
|
||||
/** Where the message was generated, e.g. "step:2", "snippet:login", "assertion:pass". */
|
||||
context?: string | null;
|
||||
message: string;
|
||||
/** JSON payload attached to the message, as a raw string; rendered pretty-printed, separately from the message. */
|
||||
data?: string | null;
|
||||
createdAt: string | number | Date;
|
||||
}
|
||||
|
||||
export interface LogOutputProps {
|
||||
entries: LogOutputEntry[];
|
||||
/** Reference point for the elapsed-time column; defaults to the first entry's timestamp. */
|
||||
startTime?: string | number | Date;
|
||||
/** Caps the block's height (e.g. "400px"), scrolling once entries overflow it. */
|
||||
maxHeight?: string | number;
|
||||
emptyMessage?: string;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
/** "+12.345s" (or "-" if before startTime, e.g. clock skew). */
|
||||
function formatElapsed(deltaMs: number): string {
|
||||
const sign = deltaMs < 0 ? '-' : '+';
|
||||
return `${sign}${(Math.abs(deltaMs) / 1000).toFixed(3)}s`;
|
||||
}
|
||||
|
||||
/** Pretty-prints `data` if it's valid JSON, otherwise returns it as-is. */
|
||||
function prettyData(data: string): string {
|
||||
try {
|
||||
return JSON.stringify(JSON.parse(data), null, 2);
|
||||
} catch {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
/** Terminal-style log viewer: one line per entry, color-coded by level. */
|
||||
export function LogOutput({
|
||||
entries,
|
||||
startTime,
|
||||
maxHeight,
|
||||
emptyMessage = 'No logs.',
|
||||
className,
|
||||
}: LogOutputProps) {
|
||||
if (entries.length === 0) {
|
||||
return <div className={styles.empty}>{emptyMessage}</div>;
|
||||
}
|
||||
|
||||
const startMs = new Date(startTime ?? entries[0].createdAt).getTime();
|
||||
|
||||
return (
|
||||
<div
|
||||
className={[styles.root, className].filter(Boolean).join(' ')}
|
||||
style={maxHeight !== undefined ? { maxHeight } : undefined}
|
||||
role="log"
|
||||
tabIndex={0}
|
||||
>
|
||||
{entries.map((entry) => {
|
||||
const entryMs = new Date(entry.createdAt).getTime();
|
||||
return (
|
||||
<div key={entry.id} className={[styles.line, styles[entry.level]].join(' ')}>
|
||||
<div className={styles.lineHeader}>
|
||||
<span className={styles.timestamp} title={new Date(entryMs).toISOString()}>
|
||||
{formatElapsed(entryMs - startMs)}
|
||||
</span>
|
||||
<span className={styles.level}>{entry.level}</span>
|
||||
{entry.context && <span className={styles.context}>{entry.context}</span>}
|
||||
<span className={styles.message}>{entry.message}</span>
|
||||
</div>
|
||||
{entry.data && (
|
||||
<div className={styles.data}>
|
||||
<CodeBlock code={prettyData(entry.data)} language="json" />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -16,6 +16,13 @@
|
||||
border-radius: var(--radius-lg);
|
||||
box-shadow: 0 20px 48px color-mix(in srgb, #000 28%, transparent);
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.lg {
|
||||
width: min(880px, 100%);
|
||||
}
|
||||
|
||||
.header {
|
||||
@@ -31,6 +38,7 @@
|
||||
.body {
|
||||
padding: var(--space-2) var(--space-5) var(--space-4);
|
||||
color: var(--color-text-muted);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.footer {
|
||||
|
||||
@@ -7,9 +7,11 @@ export interface ModalProps {
|
||||
children?: React.ReactNode;
|
||||
onClose: () => void;
|
||||
footer?: React.ReactNode;
|
||||
/** `lg` widens the dialog for long, document-like content. */
|
||||
size?: 'md' | 'lg';
|
||||
}
|
||||
|
||||
export function Modal({ open, title, children, onClose, footer }: ModalProps) {
|
||||
export function Modal({ open, title, children, onClose, footer, size = 'md' }: ModalProps) {
|
||||
useEffect(() => {
|
||||
if (!open) return;
|
||||
const onKeyDown = (event: KeyboardEvent) => {
|
||||
@@ -24,7 +26,7 @@ export function Modal({ open, title, children, onClose, footer }: ModalProps) {
|
||||
return (
|
||||
<div className={styles.overlay} role="presentation" onClick={onClose}>
|
||||
<div
|
||||
className={styles.dialog}
|
||||
className={size === 'lg' ? `${styles.dialog} ${styles.lg}` : styles.dialog}
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-label={title}
|
||||
@@ -33,7 +35,10 @@ export function Modal({ open, title, children, onClose, footer }: ModalProps) {
|
||||
<div className={styles.header}>
|
||||
<h3 className={styles.title}>{title}</h3>
|
||||
</div>
|
||||
<div className={styles.body}>{children}</div>
|
||||
{/* Long (lg) content scrolls; make it focusable so the keyboard can scroll it. */}
|
||||
<div className={styles.body} tabIndex={size === 'lg' ? 0 : undefined}>
|
||||
{children}
|
||||
</div>
|
||||
{footer && <div className={styles.footer}>{footer}</div>}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -69,3 +69,6 @@ export type { TableProps, TableColumn, SortDirection } from './Table/Table';
|
||||
|
||||
export { UuidBadge } from './UuidBadge/UuidBadge';
|
||||
export type { UuidBadgeProps } from './UuidBadge/UuidBadge';
|
||||
|
||||
export { LogOutput } from './LogOutput/LogOutput';
|
||||
export type { LogOutputProps, LogOutputEntry, LogOutputLevel } from './LogOutput/LogOutput';
|
||||
@@ -46,6 +46,7 @@
|
||||
|
||||
--color-text: #2D3339;
|
||||
--color-text-muted: #634DBD; /* Kimberly, a touch darker for 4.5:1 on bg-subtle */
|
||||
--color-text-faint: #5C6063; /* desaturated grey, ~4.5:1 on bg-subtle - as washed out as WCAG AA allows */
|
||||
--color-border: #AFBFB9; /* Powder Ash */
|
||||
--color-bg: #E6EDEA; /* Powder Ash tint */
|
||||
--color-bg-subtle: #D8E2DE; /* Powder Ash tint, 1 step darker */
|
||||
@@ -158,6 +159,7 @@ a:hover {
|
||||
|
||||
--color-text: #E2EAE6;
|
||||
--color-text-muted: #A9A3C9; /* lightened Kimberly */
|
||||
--color-text-faint: #9A9A9A; /* desaturated grey, ~4.5:1 on dark bg-subtle - as washed out as WCAG AA allows */
|
||||
--color-border: #3D4850;
|
||||
--color-bg: #1A1F24; /* deeper than Outer Space */
|
||||
--color-bg-subtle: #2D3339; /* Outer Space */
|
||||
|
||||
+5
-3
@@ -245,9 +245,11 @@ Before adding a dependency, check its license is compatible with MIT distributio
|
||||
|
||||
`.gitea/workflows/ci.yml` runs on pushes to `master` and on pull requests:
|
||||
|
||||
- **server**: lint (no warnings allowed), type-check, tests, build.
|
||||
- **client**: lint (no warnings allowed), build, Storybook tests in headless Chromium.
|
||||
- **image** (pushes to `master` only): when the push changes `version` in the root `package.json`, and both check jobs pass, builds the Docker image and pushes it to the Gitea container registry set by `REGISTRY` at the top of the workflow (`git.hq.ars9.space`) as `<registry>/<owner>/<repo>:<version>` and `:latest`.
|
||||
- **changes**: detects which of `server/` and `client/` changed (via `dorny/paths-filter`), also treating root `package.json`/`package-lock.json` and the workflow file itself as affecting both.
|
||||
- **server** (skipped if nothing under `server/` changed): lint (no warnings allowed), type-check, tests, build.
|
||||
- **client** (skipped if nothing under `client/` changed): lint (no warnings allowed), build, Storybook tests in headless Chromium.
|
||||
- **version** (pushes to `master` only): reads `version` from the root `package.json` and checks the registry for an existing `<registry>/<owner>/<repo>:<version>` image; skips the image job if that tag is already present.
|
||||
- **image** (pushes to `master` only): when the version job found no existing image for the current version, and the server/client jobs passed or were skipped, builds the Docker image and pushes it to the Gitea container registry set by `REGISTRY` at the top of the workflow (`git.hq.ars9.space`) as `<registry>/<owner>/<repo>:<version>` and `:latest`.
|
||||
|
||||
The image job logs in as the repository owner with the `REGISTRY_TOKEN` secret: a Gitea access token with package write access (Settings → Applications → token with `write:package`), added under the repository's Settings → Actions → Secrets. It runs `docker` on the runner, so the runner must give jobs access to a Docker daemon (act_runner mounts the host's Docker socket into job containers by default).
|
||||
|
||||
|
||||
+17
-4
@@ -32,9 +32,9 @@ Available on `context`:
|
||||
- `context.env`: shallow copy of the environment's key/value map
|
||||
- `context.getEnv(key)`: environment value lookup (throws if missing)
|
||||
- `context.getCredential(alias)`: payload of the credential assigned to the scenario under `alias` (parsed JSON when the data is JSON; throws if missing)
|
||||
- `context.getStepOutput(order)`: output of a previous step by absolute order (`1`, `2`, ...) or relative (`-1` = previous step); `null` if there is none
|
||||
- `context.getStepOutput(order)`: async (`await` it); output of a previous step by absolute order (`1`, `2`, ...) or relative (`-1` = previous step); `null` if there is none
|
||||
- `context.dumpDom(selector?)`: simplified DOM snapshot of the page (or of one element)
|
||||
- `context.log(...args)`, `context.warn(...args)`, `context.error(...args)`: run log entries
|
||||
- `context.log(...args)`, `context.warn(...args)`, `context.error(...args)`, `context.debug(...args)`: run log entries
|
||||
- `context.assert(() => boolean, description)`: runs the arrow function and requires it to return `true`. Logs `description` (as a `log` entry on success, as an `error` entry on failure or exception), then throws to stop the step if the function returned anything other than `true` or threw
|
||||
- `context.runSnippet(name, ...args)`: runs stored snippet code with the same context; the snippet receives the extra arguments as `...args`. `name` is the snippet alias for its latest version, or `alias@<version>` (e.g. `login@3`) to pin a specific version. Snippet start/finish/failure is logged
|
||||
- `context.getScenarioFiles(opts?)`: list files uploaded to the scenario (`limit`, `offset`), including their path on disk
|
||||
@@ -42,12 +42,25 @@ Available on `context`:
|
||||
|
||||
Also in scope:
|
||||
|
||||
- `console`: proxied to run logs (`log`, `warn`, `error`, etc.)
|
||||
- `console`: proxied to run logs (`log`/`info` → `log`, `warn`, `error`, `debug`)
|
||||
- `expect`: Playwright's `expect` (e.g. `await expect(context.page.locator("h1")).toHaveText("Done")`)
|
||||
|
||||
Code is syntax-checked before it runs, and executes in the server process: it's trusted code, not sandboxed.
|
||||
|
||||
Step run logs also include automatic "Step N started / passed / failed" entries.
|
||||
The step and snippet editors have a (?) button next to the Code label that opens a reference of this runtime in the UI. Its content is [client/src/components/modals/code-help.md](../client/src/components/modals/code-help.md): keep it in sync with this section when the `context` API changes.
|
||||
|
||||
## Run logs
|
||||
|
||||
Each run log entry (`level`, `message`, `createdAt`) also carries a `context`: where the message was generated. Contexts:
|
||||
|
||||
- `step:<N>`: the step a log entry belongs to, including the automatic "Step N started / passed / failed" entries
|
||||
- `snippet:<alias>`: entries logged while `context.runSnippet(alias, ...)` is running, including its own automatic "started"/"finished"/"failed" entries. A snippet calling another snippet tags entries with the innermost running snippet's alias
|
||||
- `assertion:pass` / `assertion:fail`: `context.assert()`'s own log entry
|
||||
- `run`: run-level entries not tied to a step (e.g. a scenario timeout, or the Playwright trace upload notice)
|
||||
|
||||
`context.log`/`warn`/`error` (and `console.log`/etc.) split their arguments: strings/numbers/booleans are joined into `message`, while object/array arguments are kept out of it and stored as `data` (JSON), so `message` stays a stable string regardless of an object's shape. With one object argument `data` is that object; with more than one, `data` is an array of them. E.g. `context.log("Saved credential as run file:", fileMeta)` logs `message: "Saved credential as run file:"` with `fileMeta` as `data`, shown pretty-printed and separately from the message in the UI.
|
||||
|
||||
`GET /scenarios/:id/runs/:runId?q=...` and the exported CSV/Markdown logs (`GET /scenarios/:id/runs/:runId/export`) match `q` against both `message` and `context`.
|
||||
|
||||
## Versioning
|
||||
|
||||
|
||||
Generated
+115
-606
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "liqa",
|
||||
"version": "1.22.2",
|
||||
"version": "1.24.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "liqa",
|
||||
"version": "1.22.2",
|
||||
"version": "1.24.0",
|
||||
"license": "MIT",
|
||||
"workspaces": [
|
||||
"server",
|
||||
@@ -1023,9 +1023,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz",
|
||||
"integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",
|
||||
"integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
@@ -1040,9 +1040,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz",
|
||||
"integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz",
|
||||
"integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -1057,9 +1057,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz",
|
||||
"integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -1074,9 +1074,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-x64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz",
|
||||
"integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -1091,9 +1091,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-arm64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz",
|
||||
"integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -1108,9 +1108,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-x64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz",
|
||||
"integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -1125,9 +1125,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-arm64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz",
|
||||
"integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -1142,9 +1142,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-x64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz",
|
||||
"integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -1159,9 +1159,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz",
|
||||
"integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz",
|
||||
"integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -1176,9 +1176,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz",
|
||||
"integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -1193,9 +1193,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ia32": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz",
|
||||
"integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz",
|
||||
"integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
@@ -1210,9 +1210,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-loong64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz",
|
||||
"integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz",
|
||||
"integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
@@ -1227,9 +1227,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-mips64el": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz",
|
||||
"integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz",
|
||||
"integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==",
|
||||
"cpu": [
|
||||
"mips64el"
|
||||
],
|
||||
@@ -1244,9 +1244,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ppc64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz",
|
||||
"integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz",
|
||||
"integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
@@ -1261,9 +1261,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-riscv64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz",
|
||||
"integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz",
|
||||
"integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
@@ -1278,9 +1278,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-s390x": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz",
|
||||
"integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz",
|
||||
"integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
@@ -1295,9 +1295,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-x64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz",
|
||||
"integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -1312,9 +1312,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-arm64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz",
|
||||
"integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -1329,9 +1329,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-x64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz",
|
||||
"integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -1346,9 +1346,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-arm64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz",
|
||||
"integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -1363,9 +1363,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-x64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz",
|
||||
"integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -1380,9 +1380,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openharmony-arm64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz",
|
||||
"integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -1397,9 +1397,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/sunos-x64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz",
|
||||
"integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -1414,9 +1414,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-arm64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz",
|
||||
"integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -1431,9 +1431,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-ia32": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz",
|
||||
"integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz",
|
||||
"integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
@@ -1448,9 +1448,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-x64": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz",
|
||||
"integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -5402,13 +5402,6 @@
|
||||
"undici-types": ">=7.24.0 <7.24.7"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node/node_modules/undici-types": {
|
||||
"version": "7.24.6",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz",
|
||||
"integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/qs": {
|
||||
"version": "6.15.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.15.1.tgz",
|
||||
@@ -8763,9 +8756,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/esbuild": {
|
||||
"version": "0.28.2",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz",
|
||||
"integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==",
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz",
|
||||
"integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
@@ -8776,32 +8769,32 @@
|
||||
"node": ">=18"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@esbuild/aix-ppc64": "0.28.2",
|
||||
"@esbuild/android-arm": "0.28.2",
|
||||
"@esbuild/android-arm64": "0.28.2",
|
||||
"@esbuild/android-x64": "0.28.2",
|
||||
"@esbuild/darwin-arm64": "0.28.2",
|
||||
"@esbuild/darwin-x64": "0.28.2",
|
||||
"@esbuild/freebsd-arm64": "0.28.2",
|
||||
"@esbuild/freebsd-x64": "0.28.2",
|
||||
"@esbuild/linux-arm": "0.28.2",
|
||||
"@esbuild/linux-arm64": "0.28.2",
|
||||
"@esbuild/linux-ia32": "0.28.2",
|
||||
"@esbuild/linux-loong64": "0.28.2",
|
||||
"@esbuild/linux-mips64el": "0.28.2",
|
||||
"@esbuild/linux-ppc64": "0.28.2",
|
||||
"@esbuild/linux-riscv64": "0.28.2",
|
||||
"@esbuild/linux-s390x": "0.28.2",
|
||||
"@esbuild/linux-x64": "0.28.2",
|
||||
"@esbuild/netbsd-arm64": "0.28.2",
|
||||
"@esbuild/netbsd-x64": "0.28.2",
|
||||
"@esbuild/openbsd-arm64": "0.28.2",
|
||||
"@esbuild/openbsd-x64": "0.28.2",
|
||||
"@esbuild/openharmony-arm64": "0.28.2",
|
||||
"@esbuild/sunos-x64": "0.28.2",
|
||||
"@esbuild/win32-arm64": "0.28.2",
|
||||
"@esbuild/win32-ia32": "0.28.2",
|
||||
"@esbuild/win32-x64": "0.28.2"
|
||||
"@esbuild/aix-ppc64": "0.25.12",
|
||||
"@esbuild/android-arm": "0.25.12",
|
||||
"@esbuild/android-arm64": "0.25.12",
|
||||
"@esbuild/android-x64": "0.25.12",
|
||||
"@esbuild/darwin-arm64": "0.25.12",
|
||||
"@esbuild/darwin-x64": "0.25.12",
|
||||
"@esbuild/freebsd-arm64": "0.25.12",
|
||||
"@esbuild/freebsd-x64": "0.25.12",
|
||||
"@esbuild/linux-arm": "0.25.12",
|
||||
"@esbuild/linux-arm64": "0.25.12",
|
||||
"@esbuild/linux-ia32": "0.25.12",
|
||||
"@esbuild/linux-loong64": "0.25.12",
|
||||
"@esbuild/linux-mips64el": "0.25.12",
|
||||
"@esbuild/linux-ppc64": "0.25.12",
|
||||
"@esbuild/linux-riscv64": "0.25.12",
|
||||
"@esbuild/linux-s390x": "0.25.12",
|
||||
"@esbuild/linux-x64": "0.25.12",
|
||||
"@esbuild/netbsd-arm64": "0.25.12",
|
||||
"@esbuild/netbsd-x64": "0.25.12",
|
||||
"@esbuild/openbsd-arm64": "0.25.12",
|
||||
"@esbuild/openbsd-x64": "0.25.12",
|
||||
"@esbuild/openharmony-arm64": "0.25.12",
|
||||
"@esbuild/sunos-x64": "0.25.12",
|
||||
"@esbuild/win32-arm64": "0.25.12",
|
||||
"@esbuild/win32-ia32": "0.25.12",
|
||||
"@esbuild/win32-x64": "0.25.12"
|
||||
}
|
||||
},
|
||||
"node_modules/escalade": {
|
||||
@@ -16451,9 +16444,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "7.30.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.30.0.tgz",
|
||||
"integrity": "sha512-7QjA5O+GhM27do7Id6hQZpnYEd7WzHbs7/XIS9A1k+Gat/ZVF7Jmpzt68zL/205f65FYwDNLSjQemHPS8ReM/A==",
|
||||
"version": "7.24.6",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz",
|
||||
"integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
@@ -16822,490 +16815,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",
|
||||
"integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"aix"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/android-arm": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz",
|
||||
"integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/android-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/android-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/darwin-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/darwin-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/freebsd-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/freebsd-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/linux-arm": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz",
|
||||
"integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/linux-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/linux-ia32": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz",
|
||||
"integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/linux-loong64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz",
|
||||
"integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/linux-mips64el": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz",
|
||||
"integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==",
|
||||
"cpu": [
|
||||
"mips64el"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/linux-ppc64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz",
|
||||
"integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/linux-riscv64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz",
|
||||
"integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/linux-s390x": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz",
|
||||
"integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/linux-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/netbsd-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"netbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/netbsd-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"netbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/openbsd-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/openbsd-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/openharmony-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openharmony"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/sunos-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"sunos"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/win32-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/win32-ia32": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz",
|
||||
"integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/win32-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/esbuild": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz",
|
||||
"integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"esbuild": "bin/esbuild"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@esbuild/aix-ppc64": "0.25.12",
|
||||
"@esbuild/android-arm": "0.25.12",
|
||||
"@esbuild/android-arm64": "0.25.12",
|
||||
"@esbuild/android-x64": "0.25.12",
|
||||
"@esbuild/darwin-arm64": "0.25.12",
|
||||
"@esbuild/darwin-x64": "0.25.12",
|
||||
"@esbuild/freebsd-arm64": "0.25.12",
|
||||
"@esbuild/freebsd-x64": "0.25.12",
|
||||
"@esbuild/linux-arm": "0.25.12",
|
||||
"@esbuild/linux-arm64": "0.25.12",
|
||||
"@esbuild/linux-ia32": "0.25.12",
|
||||
"@esbuild/linux-loong64": "0.25.12",
|
||||
"@esbuild/linux-mips64el": "0.25.12",
|
||||
"@esbuild/linux-ppc64": "0.25.12",
|
||||
"@esbuild/linux-riscv64": "0.25.12",
|
||||
"@esbuild/linux-s390x": "0.25.12",
|
||||
"@esbuild/linux-x64": "0.25.12",
|
||||
"@esbuild/netbsd-arm64": "0.25.12",
|
||||
"@esbuild/netbsd-x64": "0.25.12",
|
||||
"@esbuild/openbsd-arm64": "0.25.12",
|
||||
"@esbuild/openbsd-x64": "0.25.12",
|
||||
"@esbuild/openharmony-arm64": "0.25.12",
|
||||
"@esbuild/sunos-x64": "0.25.12",
|
||||
"@esbuild/win32-arm64": "0.25.12",
|
||||
"@esbuild/win32-ia32": "0.25.12",
|
||||
"@esbuild/win32-x64": "0.25.12"
|
||||
}
|
||||
},
|
||||
"node_modules/vitest": {
|
||||
"version": "4.1.11",
|
||||
"resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.11.tgz",
|
||||
@@ -17415,9 +16924,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vitest/node_modules/chai": {
|
||||
"version": "6.2.2",
|
||||
"resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz",
|
||||
"integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==",
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz",
|
||||
"integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "liqa",
|
||||
"version": "1.22.2",
|
||||
"version": "1.24.0",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"author": "Andrii Arsenin",
|
||||
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
# Installs liqa into a target directory: writes a compose.yaml pulling the
|
||||
# published image (git.hq.ars9.space/ars9/liqa) and creates ./data for the
|
||||
# SQLite database, so the install directory needs no copy of this repo.
|
||||
set -euo pipefail
|
||||
|
||||
REGISTRY_IMAGE="git.hq.ars9.space/ars9/liqa"
|
||||
|
||||
read -rp "Install directory [./liqa]: " install_dir
|
||||
install_dir="${install_dir:-./liqa}"
|
||||
|
||||
read -rp "Port to expose [13000]: " port
|
||||
port="${port:-13000}"
|
||||
|
||||
read -rp "Version to install [latest]: " version
|
||||
version="${version:-latest}"
|
||||
|
||||
mkdir -p "$install_dir/data"
|
||||
|
||||
compose_file="$install_dir/compose.yaml"
|
||||
cat > "$compose_file" <<EOF
|
||||
services:
|
||||
liqa:
|
||||
image: ${REGISTRY_IMAGE}:${version}
|
||||
ports:
|
||||
- "${port}:3000"
|
||||
env_file:
|
||||
- path: .env
|
||||
required: false
|
||||
volumes:
|
||||
- ./data:/app/data
|
||||
restart: unless-stopped
|
||||
EOF
|
||||
|
||||
echo "Wrote $compose_file"
|
||||
echo "Created $install_dir/data"
|
||||
echo
|
||||
echo "To start liqa:"
|
||||
echo " cd $install_dir && docker compose up -d"
|
||||
@@ -19,8 +19,12 @@ export interface ExecResult {
|
||||
}
|
||||
|
||||
export type ScriptLogger = (
|
||||
level: "log" | "warn" | "error",
|
||||
level: "debug" | "log" | "warn" | "error",
|
||||
message: string,
|
||||
/** Where the message was generated, e.g. "step:2", "snippet:login", "assertion:pass". */
|
||||
context?: string | null,
|
||||
/** Structured payload attached to the message (e.g. a created file's metadata). */
|
||||
data?: unknown,
|
||||
) => void;
|
||||
|
||||
/** The `context` object available inside user scripts as the sole argument. */
|
||||
@@ -42,6 +46,7 @@ export interface ScriptContext {
|
||||
log: (...args: unknown[]) => void;
|
||||
warn: (...args: unknown[]) => void;
|
||||
error: (...args: unknown[]) => void;
|
||||
debug: (...args: unknown[]) => void;
|
||||
/**
|
||||
* Runs `fn` and requires it to return `true`. Logs the outcome under
|
||||
* `description`, then throws if `fn` returned anything other than `true`
|
||||
@@ -70,6 +75,8 @@ export interface ExecContext {
|
||||
browser: BrowserContext;
|
||||
code: string;
|
||||
log?: ScriptLogger;
|
||||
/** Base log context for this execution, e.g. "step:2". */
|
||||
logContext?: string | null;
|
||||
getStepOutput?: (order: number) => Promise<unknown>;
|
||||
credentials?: Record<string, unknown>;
|
||||
environment?: EnvironmentData | null;
|
||||
@@ -110,6 +117,7 @@ export class CodeExecutorService {
|
||||
browser,
|
||||
code,
|
||||
log,
|
||||
logContext,
|
||||
getStepOutput,
|
||||
credentials,
|
||||
environment,
|
||||
@@ -120,10 +128,44 @@ export class CodeExecutorService {
|
||||
} = ctx;
|
||||
const scriptLog: ScriptLogger =
|
||||
log ?? ((level, msg) => this.logger[level](msg));
|
||||
const toStr = (args: unknown[]) =>
|
||||
args
|
||||
.map((a) => (typeof a === "object" ? JSON.stringify(a) : String(a)))
|
||||
.join(" ");
|
||||
|
||||
// Splits console/log args into a plain-text message (strings, numbers, ...)
|
||||
// and a structured data payload (objects/arrays), logged separately so the
|
||||
// message stays a stable string regardless of the object's shape.
|
||||
const splitLogArgs = (
|
||||
args: unknown[],
|
||||
): { message: string; data: unknown } => {
|
||||
const strings: string[] = [];
|
||||
const objects: unknown[] = [];
|
||||
for (const a of args) {
|
||||
if (a !== null && typeof a === "object") {
|
||||
objects.push(a);
|
||||
} else {
|
||||
strings.push(String(a));
|
||||
}
|
||||
}
|
||||
return {
|
||||
message: strings.join(" "),
|
||||
data: objects.length === 0 ? null : objects.length === 1 ? objects[0] : objects,
|
||||
};
|
||||
};
|
||||
|
||||
// Innermost running snippet (if any) tags log entries; falls back to
|
||||
// logContext (e.g. the current step) outside of any runSnippet call.
|
||||
const contextStack: string[] = logContext ? [logContext] : [];
|
||||
const currentContext = (): string | null =>
|
||||
contextStack.length > 0 ? contextStack[contextStack.length - 1] : null;
|
||||
const emit = (
|
||||
level: "debug" | "log" | "warn" | "error",
|
||||
message: string,
|
||||
contextOverride?: string,
|
||||
data?: unknown,
|
||||
): void =>
|
||||
scriptLog(level, message, contextOverride ?? currentContext(), data);
|
||||
const emitArgs = (level: "debug" | "log" | "warn" | "error", args: unknown[]): void => {
|
||||
const { message, data } = splitLogArgs(args);
|
||||
emit(level, message, undefined, data);
|
||||
};
|
||||
|
||||
const credMap: Record<string, unknown> = credentials ?? {};
|
||||
const envData: EnvironmentData = environment ?? {};
|
||||
@@ -133,11 +175,11 @@ export class CodeExecutorService {
|
||||
let scriptContext: ScriptContext;
|
||||
|
||||
const fakeConsole = {
|
||||
log: (...args: unknown[]) => scriptLog("log", toStr(args)),
|
||||
warn: (...args: unknown[]) => scriptLog("warn", toStr(args)),
|
||||
error: (...args: unknown[]) => scriptLog("error", toStr(args)),
|
||||
info: (...args: unknown[]) => scriptLog("log", toStr(args)),
|
||||
debug: (...args: unknown[]) => scriptLog("log", toStr(args)),
|
||||
log: (...args: unknown[]) => emitArgs("log", args),
|
||||
warn: (...args: unknown[]) => emitArgs("warn", args),
|
||||
error: (...args: unknown[]) => emitArgs("error", args),
|
||||
info: (...args: unknown[]) => emitArgs("log", args),
|
||||
debug: (...args: unknown[]) => emitArgs("debug", args),
|
||||
};
|
||||
|
||||
try {
|
||||
@@ -145,9 +187,10 @@ export class CodeExecutorService {
|
||||
page,
|
||||
browser,
|
||||
dumpDom: (selector?: string) => dumpDom(page, selector),
|
||||
log: (...args: unknown[]) => scriptLog("log", toStr(args)),
|
||||
warn: (...args: unknown[]) => scriptLog("warn", toStr(args)),
|
||||
error: (...args: unknown[]) => scriptLog("error", toStr(args)),
|
||||
log: (...args: unknown[]) => emitArgs("log", args),
|
||||
warn: (...args: unknown[]) => emitArgs("warn", args),
|
||||
error: (...args: unknown[]) => emitArgs("error", args),
|
||||
debug: (...args: unknown[]) => emitArgs("debug", args),
|
||||
assert: async (
|
||||
fn: () => boolean | Promise<boolean>,
|
||||
description: string,
|
||||
@@ -161,13 +204,13 @@ export class CodeExecutorService {
|
||||
failureReason = (err as Error).message;
|
||||
}
|
||||
if (passed) {
|
||||
scriptLog("log", `Assertion passed: ${description}`);
|
||||
emit("log", description, "assertion:pass");
|
||||
return;
|
||||
}
|
||||
const message = failureReason
|
||||
? `Assertion failed: ${description} (${failureReason})`
|
||||
: `Assertion failed: ${description}`;
|
||||
scriptLog("error", message);
|
||||
emit("error", message, "assertion:fail");
|
||||
throw new Error(message);
|
||||
},
|
||||
getStepOutput: getStepOutput ?? (() => Promise.resolve(null)),
|
||||
@@ -197,7 +240,9 @@ export class CodeExecutorService {
|
||||
if (snippetCode == null) {
|
||||
throw new Error(`Snippet alias "${alias}" not found`);
|
||||
}
|
||||
scriptLog("log", `Snippet "${alias}" started`);
|
||||
const snippetContext = `snippet:${alias}`;
|
||||
contextStack.push(snippetContext);
|
||||
emit("log", `Snippet "${alias}" started`, snippetContext);
|
||||
const snippetFn = new Function(
|
||||
"context",
|
||||
"console",
|
||||
@@ -212,14 +257,17 @@ export class CodeExecutorService {
|
||||
args,
|
||||
playwrightExpect,
|
||||
);
|
||||
scriptLog("log", `Snippet "${alias}" finished`);
|
||||
emit("log", `Snippet "${alias}" finished`, snippetContext);
|
||||
return snippetResult;
|
||||
} catch (err) {
|
||||
scriptLog(
|
||||
emit(
|
||||
"error",
|
||||
`Snippet "${alias}" failed: ${(err as Error).message}`,
|
||||
snippetContext,
|
||||
);
|
||||
throw err;
|
||||
} finally {
|
||||
contextStack.pop();
|
||||
}
|
||||
},
|
||||
getScenarioFiles: async (opts?: { limit?: number; offset?: number }) => {
|
||||
|
||||
@@ -26,6 +26,11 @@ export class ExecContextBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
logContext(logContext: string): this {
|
||||
this.ctx.logContext = logContext;
|
||||
return this;
|
||||
}
|
||||
|
||||
getStepOutput(fn: (order: number) => Promise<unknown>): this {
|
||||
this.ctx.getStepOutput = fn;
|
||||
return this;
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class AddRunLogContext1790848194828 implements MigrationInterface {
|
||||
name = "AddRunLogContext1790848194828";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE "temporary_scenario_run_logs" ("id" varchar PRIMARY KEY NOT NULL, "runId" varchar NOT NULL, "stepRunId" varchar, "level" text NOT NULL DEFAULT ('log'), "message" text NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "seq" integer NOT NULL DEFAULT (0), "context" text, CONSTRAINT "FK_dde48478a42823e583a360dd468" FOREIGN KEY ("runId") REFERENCES "scenario_runs" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_62d82b9fce3a6a2947ed1136c67" FOREIGN KEY ("stepRunId") REFERENCES "scenario_run_steps" ("id") ON DELETE SET NULL ON UPDATE NO ACTION)`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`INSERT INTO "temporary_scenario_run_logs"("id", "runId", "stepRunId", "level", "message", "createdAt", "seq") SELECT "id", "runId", "stepRunId", "level", "message", "createdAt", "seq" FROM "scenario_run_logs"`,
|
||||
);
|
||||
await queryRunner.query(`DROP TABLE "scenario_run_logs"`);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "temporary_scenario_run_logs" RENAME TO "scenario_run_logs"`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "scenario_run_logs" RENAME TO "temporary_scenario_run_logs"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE "scenario_run_logs" ("id" varchar PRIMARY KEY NOT NULL, "runId" varchar NOT NULL, "stepRunId" varchar, "level" text NOT NULL DEFAULT ('log'), "message" text NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "seq" integer NOT NULL DEFAULT (0), CONSTRAINT "FK_dde48478a42823e583a360dd468" FOREIGN KEY ("runId") REFERENCES "scenario_runs" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_62d82b9fce3a6a2947ed1136c67" FOREIGN KEY ("stepRunId") REFERENCES "scenario_run_steps" ("id") ON DELETE SET NULL ON UPDATE NO ACTION)`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`INSERT INTO "scenario_run_logs"("id", "runId", "stepRunId", "level", "message", "createdAt", "seq") SELECT "id", "runId", "stepRunId", "level", "message", "createdAt", "seq" FROM "temporary_scenario_run_logs"`,
|
||||
);
|
||||
await queryRunner.query(`DROP TABLE "temporary_scenario_run_logs"`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class AddRunLogData1790850734763 implements MigrationInterface {
|
||||
name = "AddRunLogData1790850734763";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE "temporary_scenario_run_logs" ("id" varchar PRIMARY KEY NOT NULL, "runId" varchar NOT NULL, "stepRunId" varchar, "level" text NOT NULL DEFAULT ('log'), "message" text NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "seq" integer NOT NULL DEFAULT (0), "context" text, "data" text, CONSTRAINT "FK_62d82b9fce3a6a2947ed1136c67" FOREIGN KEY ("stepRunId") REFERENCES "scenario_run_steps" ("id") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT "FK_dde48478a42823e583a360dd468" FOREIGN KEY ("runId") REFERENCES "scenario_runs" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`INSERT INTO "temporary_scenario_run_logs"("id", "runId", "stepRunId", "level", "message", "createdAt", "seq", "context") SELECT "id", "runId", "stepRunId", "level", "message", "createdAt", "seq", "context" FROM "scenario_run_logs"`,
|
||||
);
|
||||
await queryRunner.query(`DROP TABLE "scenario_run_logs"`);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "temporary_scenario_run_logs" RENAME TO "scenario_run_logs"`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "scenario_run_logs" RENAME TO "temporary_scenario_run_logs"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE "scenario_run_logs" ("id" varchar PRIMARY KEY NOT NULL, "runId" varchar NOT NULL, "stepRunId" varchar, "level" text NOT NULL DEFAULT ('log'), "message" text NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "seq" integer NOT NULL DEFAULT (0), "context" text, CONSTRAINT "FK_62d82b9fce3a6a2947ed1136c67" FOREIGN KEY ("stepRunId") REFERENCES "scenario_run_steps" ("id") ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT "FK_dde48478a42823e583a360dd468" FOREIGN KEY ("runId") REFERENCES "scenario_runs" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`INSERT INTO "scenario_run_logs"("id", "runId", "stepRunId", "level", "message", "createdAt", "seq", "context") SELECT "id", "runId", "stepRunId", "level", "message", "createdAt", "seq", "context" FROM "temporary_scenario_run_logs"`,
|
||||
);
|
||||
await queryRunner.query(`DROP TABLE "temporary_scenario_run_logs"`);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,13 @@
|
||||
import { Initial1790793447827 } from "./1790793447827-Initial";
|
||||
import { AddRunLogContext1790848194828 } from "./1790848194828-AddRunLogContext";
|
||||
import { AddRunLogData1790850734763 } from "./1790850734763-AddRunLogData";
|
||||
|
||||
/**
|
||||
* All migrations, oldest first. Listed explicitly (instead of a glob) so the
|
||||
* same list works from compiled JS, ts-jest and the TypeORM CLI.
|
||||
*/
|
||||
export const MIGRATIONS = [Initial1790793447827];
|
||||
export const MIGRATIONS = [
|
||||
Initial1790793447827,
|
||||
AddRunLogContext1790848194828,
|
||||
AddRunLogData1790850734763,
|
||||
];
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
import { ScenarioRunStepEntity } from "./scenario-run-step.entity";
|
||||
import { ScenarioRunEntity } from "./scenario-run.entity";
|
||||
|
||||
export type LogLevel = "log" | "warn" | "error";
|
||||
export type LogLevel = "debug" | "log" | "warn" | "error";
|
||||
|
||||
@Entity("scenario_run_logs")
|
||||
export class ScenarioRunLogEntity {
|
||||
@@ -36,9 +36,18 @@ export class ScenarioRunLogEntity {
|
||||
@Column({ type: "text", default: "log" })
|
||||
level: LogLevel;
|
||||
|
||||
// Where the message was generated, e.g. "step:2", "snippet:login", "assertion:pass"
|
||||
@Column({ type: "text", nullable: true })
|
||||
context: string | null;
|
||||
|
||||
@Column({ type: "text" })
|
||||
message: string;
|
||||
|
||||
// JSON payload attached to the message (e.g. a created file's metadata),
|
||||
// kept separate so message stays a stable, human-readable string.
|
||||
@Column({ type: "text", nullable: true })
|
||||
data: string | null;
|
||||
|
||||
// Assigned in call order per run, since concurrent unawaited writes can
|
||||
// otherwise persist out of order (createdAt alone isn't a reliable tiebreaker).
|
||||
@Column({ type: "int", default: 0 })
|
||||
|
||||
@@ -143,26 +143,36 @@ export class ScenarioSchedulerService implements OnModuleInit {
|
||||
statuses: ["pending", "waiting"],
|
||||
})
|
||||
.execute();
|
||||
this.persistLog(runId, null, "error", reason);
|
||||
this.persistLog(runId, null, "error", reason, "run");
|
||||
}
|
||||
|
||||
private persistLog(
|
||||
runId: string,
|
||||
stepRunId: string | null,
|
||||
level: "log" | "warn" | "error",
|
||||
level: "debug" | "log" | "warn" | "error",
|
||||
message: string,
|
||||
context: string | null = null,
|
||||
data: unknown = null,
|
||||
): void {
|
||||
const seq = (this.runLogSeq.get(runId) ?? 0) + 1;
|
||||
this.runLogSeq.set(runId, seq);
|
||||
void this.runLogRepo.save(
|
||||
this.runLogRepo.create({ runId, stepRunId, level, message, seq }),
|
||||
this.runLogRepo.create({
|
||||
runId,
|
||||
stepRunId,
|
||||
level,
|
||||
message,
|
||||
context,
|
||||
data: data != null ? JSON.stringify(data) : null,
|
||||
seq,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
private stepLogger(stepRunId: string, runId: string): ScriptLogger {
|
||||
return (level, msg) => {
|
||||
return (level, msg, context, data) => {
|
||||
this.logger[level](`StepRun #${stepRunId} script: ${msg}`);
|
||||
this.persistLog(runId, stepRunId, level, msg);
|
||||
this.persistLog(runId, stepRunId, level, msg, context ?? null, data ?? null);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -384,6 +394,7 @@ export class ScenarioSchedulerService implements OnModuleInit {
|
||||
stepRun.id,
|
||||
"log",
|
||||
`Step ${step.order} started${step.title ? `: ${step.title}` : ""}`,
|
||||
`step:${step.order}`,
|
||||
);
|
||||
|
||||
try {
|
||||
@@ -402,6 +413,7 @@ export class ScenarioSchedulerService implements OnModuleInit {
|
||||
.browser(context)
|
||||
.code(step.execCode)
|
||||
.log(this.stepLogger(stepRun.id, stepRun.runId))
|
||||
.logContext(`step:${step.order}`)
|
||||
.getStepOutput(getStepOutput)
|
||||
.credentials(creds)
|
||||
.environment(env)
|
||||
@@ -527,6 +539,7 @@ export class ScenarioSchedulerService implements OnModuleInit {
|
||||
null,
|
||||
"log",
|
||||
"Playwright trace uploaded to run files (open with `npx playwright show-trace trace.zip` or https://trace.playwright.dev)",
|
||||
"run",
|
||||
);
|
||||
} catch (err) {
|
||||
this.logger.warn(
|
||||
@@ -557,6 +570,7 @@ export class ScenarioSchedulerService implements OnModuleInit {
|
||||
stepRun.id,
|
||||
"log",
|
||||
`Step ${stepRun.order} passed`,
|
||||
`step:${stepRun.order}`,
|
||||
);
|
||||
|
||||
// Find the next waiting step in this run (next by order)
|
||||
@@ -599,6 +613,7 @@ export class ScenarioSchedulerService implements OnModuleInit {
|
||||
stepRun.id,
|
||||
"error",
|
||||
`Step ${stepRun.order} failed: ${description}`,
|
||||
`step:${stepRun.order}`,
|
||||
);
|
||||
|
||||
await this.dumpPageOnFailure(stepRun);
|
||||
@@ -666,6 +681,7 @@ export class ScenarioSchedulerService implements OnModuleInit {
|
||||
stepRun.id,
|
||||
"log",
|
||||
`Step ${stepRun.order} failed: page dump uploaded to run files`,
|
||||
`step:${stepRun.order}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -578,7 +578,12 @@ export class ScenarioService implements OnModuleInit {
|
||||
`Run ${runId} not found in scenario ${scenarioId}`,
|
||||
);
|
||||
const logs = await this.runLogRepo.find({
|
||||
where: q?.trim() ? { runId, message: Like(`%${q.trim()}%`) } : { runId },
|
||||
where: q?.trim()
|
||||
? [
|
||||
{ runId, message: Like(`%${q.trim()}%`) },
|
||||
{ runId, context: Like(`%${q.trim()}%`) },
|
||||
]
|
||||
: { runId },
|
||||
order: { seq: "ASC", createdAt: "ASC" },
|
||||
});
|
||||
return Object.assign(run, { logs });
|
||||
@@ -606,9 +611,9 @@ export class ScenarioService implements OnModuleInit {
|
||||
const escapeCsv = (value: string): string =>
|
||||
/[",\n]/.test(value) ? `"${value.replace(/"/g, '""')}"` : value;
|
||||
const rows = [
|
||||
["Timestamp", "Level", "Message"].map(escapeCsv).join(","),
|
||||
["Timestamp", "Level", "Context", "Message", "Data"].map(escapeCsv).join(","),
|
||||
...logs.map((l) =>
|
||||
[l.createdAt.toISOString(), l.level, l.message]
|
||||
[l.createdAt.toISOString(), l.level, l.context ?? "", l.message, l.data ?? ""]
|
||||
.map((v) => escapeCsv(String(v)))
|
||||
.join(","),
|
||||
),
|
||||
@@ -616,9 +621,13 @@ export class ScenarioService implements OnModuleInit {
|
||||
return rows.join("\n");
|
||||
}
|
||||
|
||||
const sections = logs.map(
|
||||
(l) => `## [${l.level}] ${l.createdAt.toISOString()}\n\n${l.message}`,
|
||||
);
|
||||
const sections = logs.map((l) => {
|
||||
const header = `## [${l.level}]${l.context ? ` (${l.context})` : ""} ${l.createdAt.toISOString()}`;
|
||||
const data = l.data
|
||||
? `\n\n\`\`\`json\n${JSON.stringify(JSON.parse(l.data), null, 2)}\n\`\`\``
|
||||
: "";
|
||||
return `${header}\n\n${l.message}${data}`;
|
||||
});
|
||||
return [`# Run ${runId} logs`, ...sections].join("\n\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -48,12 +48,14 @@ describe("Database migrations", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("can revert the initial migration", async () => {
|
||||
it("can revert all migrations", async () => {
|
||||
const dataSource = new DataSource(dataSourceOptions(":memory:"));
|
||||
await dataSource.initialize();
|
||||
try {
|
||||
await dataSource.runMigrations();
|
||||
await dataSource.undoLastMigration();
|
||||
for (let i = 0; i < MIGRATIONS.length; i++) {
|
||||
await dataSource.undoLastMigration();
|
||||
}
|
||||
const tables = await dataSource.query(
|
||||
`SELECT name FROM sqlite_master WHERE type = 'table' AND name NOT IN ('migrations', 'sqlite_sequence')`,
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user