Skip to content
Open
8 changes: 7 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ RUN --mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
php \
php-cli \
# includes certutil for dev cert verification
libnss3-tools
libnss3-tools \
# Playwright system dependencies (headless Chromium, English-only)
libasound2t64 libatk-bridge2.0-0t64 libatk1.0-0t64 libatspi2.0-0t64 \
libcairo2 libcups2t64 libdbus-1-3 libdrm2 libgbm1 libglib2.0-0t64 \
libnspr4 libnss3 libpango-1.0-0 libx11-6 libxcb1 libxcomposite1 \
libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrandr2 \
libfontconfig1 libfreetype6 fonts-liberation fonts-freefont-ttf
# Install Vale
ARG VALE_VERSION=3.12.0
RUN set -eux; \
Expand Down
22 changes: 19 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,22 @@
"kubectl": "latest",
"helm": "latest"
},
"ghcr.io/devcontainers/features/dotnet:2": {},
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {},
"ghcr.io/devcontainers-extra/features/markdownlint-cli2:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"./features/aspire": {
"version": "13.1.1"
},
"ghcr.io/devcontainers/features/go:1": {},
"ghcr.io/devcontainers/features/terraform:1": {},
"ghcr.io/devcontainers-extra/features/go-task:1": {}
"ghcr.io/devcontainers-extra/features/go-task:1": {},
"ghcr.io/devcontainers/features/desktop-lite:1": {
"password": "crucible",
"webPort": "6080",
"vncPort": "5901"
}
},
"containerEnv": {
"NUGET_PACKAGES": "/home/vscode/.nuget/packages", // this might not be needed. will try removing later.
Expand Down Expand Up @@ -59,7 +67,8 @@
"postStartCommand": "bash -l .devcontainer/poststart.sh",
"forwardPorts": [
9003, // Xdebug
443 // Minikube ingress
443, // Minikube ingress
6080 // noVNC (Playwright headed browser)
],
"customizations": {
"vscode": {
Expand All @@ -76,6 +85,7 @@
"shd101wyy.markdown-preview-enhanced",
"pflannery.vscode-versionlens",
"Anthropic.claude-code",
"ms-playwright.playwright",
"AmazonWebServices.aws-toolkit-vscode",
"bmewburn.vscode-intelephense-client",
"xdebug.php-debug"
Expand All @@ -93,7 +103,13 @@
// Enable when working on Moodle/PHP: Extensions > Intelephense > Enable (Workspace)
"intelephense.enable": false,
// Disable CloudFormation language server to save ~163MB memory (not used in this project)
"aws.cloudFormation.enable": false
"aws.cloudFormation.enable": false,
// Point Playwright extension to the test project
"playwright.reuseBrowser": true,
"playwright.env": {},
"playwright.configs": [
"/mnt/data/crucible/crucible-tests/playwright.config.ts"
]
}
}
}
Expand Down
26 changes: 25 additions & 1 deletion .devcontainer/postcreate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,31 @@ DOTNET_EF_PID=$!
(npm config -g set fund false && npm install -g @angular/cli@latest) &
ANGULAR_PID=$!

wait $DOTNET_EF_PID $ANGULAR_PID
# Initialize Playwright test agents in the dev container
PLAYWRIGHT_TESTING_DIR="/mnt/data/crucible/libraries/crucible-tests"
if [ -d "$PLAYWRIGHT_TESTING_DIR" ]; then
(
cd "$PLAYWRIGHT_TESTING_DIR" || exit 1

echo "Installing Playwright dependencies..."
npm install

echo "Installing Playwright browser binaries..."
npx playwright install chromium
npx playwright install firefox

echo "Initializing Playwright test agents..."
TMPDIR=$(mktemp -d)
cd "$TMPDIR"
npx --prefix "$PLAYWRIGHT_TESTING_DIR" playwright init-agents --loop=claude --config "$PLAYWRIGHT_TESTING_DIR/playwright.config.ts"
mkdir -p /workspaces/crucible-development/.claude/agents
cp "$TMPDIR/.claude/agents/"*.md /workspaces/crucible-development/.claude/agents/
rm -rf "$TMPDIR"
) &
PLAYWRIGHT_AGENTS_PID=$!
fi

wait $DOTNET_EF_PID $ANGULAR_PID ${PLAYWRIGHT_AGENTS_PID:-}
echo "Tool installs complete."

# Generate dotnet dev-cert. Needed if not using aspire extension launch profiles
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ helm-charts/crucible/files/*.crt
# playwright mcp logs
.playwright-mcp/

# Generated Playwright test agents
.claude/agents/

# Local repository configurations (private/internal/personal repos, local overrides)
scripts/repos.local.json

Expand Down
15 changes: 12 additions & 3 deletions .mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"aspire": {
"command": "aspire",
"args": [
"mcp",
"start"
"agent",
"mcp"
]
},
"playwright": {
Expand All @@ -13,6 +13,15 @@
"-y",
"@playwright/mcp@latest"
]
},
"playwright-test": {
"command": "/mnt/data/crucible/crucible-tests/node_modules/.bin/playwright",
"args": [
"run-test-mcp-server",
"--config",
"/mnt/data/crucible/crucible-tests/playwright.config.ts"
],
"cwd": "/mnt/data/crucible/crucible-tests"
}
}
}
}
3 changes: 3 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ IMPORTANT! Aspire is designed to capture rich logs and telemetry for all resourc
## Playwright MCP server
The playwright MCP server has also been configured in this repository and you should use it to perform functional investigations of the resources defined in the app model as you work on the codebase. To get endpoints that can be used for navigation using the playwright MCP server use the list resources tool.

## Playwright Test Suite
End-to-end Playwright tests live at `/mnt/data/crucible/crucible-tests/`. This repo contains test plans and spec files for all 11 Crucible applications. See the `README.md` in that directory for full details on test conventions, fixtures, and how to write/run tests. When asked to create, update, or run Playwright tests, work in that directory.

## Aspire workload
IMPORTANT! The aspire workload is obsolete. You should never attempt to install or use the Aspire workload.

Expand Down
Loading
Loading