Skip to content

Instantly share code, notes, and snippets.

View ianjennings's full-sized avatar

Ian Jennings ianjennings

View GitHub Profile
@ianjennings
ianjennings / cdp.js
Created June 8, 2026 14:32
TestDriver CDP Cookie Auth
const CDP_CFG = {
nodePath: 'NODE_PATH=/usr/lib/node_modules',
cookieFile: '/tmp/chatgpt-session.json',
};
const CDP_PORT = 9222;
const SNIPPET = {
listPages: ` const targets = await CDP.List({ port: ${CDP_PORT} });
const pages = targets.filter((t) => t.type === 'page');`,
posthogPage: ` const target = pages.find((t) => /posthog\\.com/i.test(t.url || '')) || pages[0];

Monorepo Conversion Architecture Guide

This guide explains how to turn multiple GitHub repositories into a single monorepo with a clean developer experience, predictable releases, and environment-safe operations. It is written for an intermediate full-stack developer and is based on patterns used in this repository.

1. What You Are Building

Target state:

  • One repository with multiple services and shared packages.
  • One consistent local environment via Dev Containers.
# Launch Win11Debloat with selected parameters
& ([scriptblock]::Create((irm "https://debloat.raphi.re/"))) -Silent -RunDefaults
-RemoveApps
-RemoveHPApps
-RemoveDevApps
-RemoveGamingApps
-DisableTelemetry
-DisableSuggestions
-DisableDesktopSpotlight
-DisableLockscreenTips
const startAppScript = fs.readFileSync(path.join(__dirname, "scripts/start.ps1"), "utf-8");
const installScriptWithParams = `
$DownloadedFile = "${installerPath.replace(/\\/g, '\\\\')}"
$InstallerFile = "${installerFile}"
${installScript}
`;
await testdriver.exec('pwsh', installScriptWithParams, 300000);

Testing Todo Creation with Playwright

This tutorial demonstrates how to test a todo app using TodoMVC as an example. Each step shows how to drive the UI with Playwright and verify that new todos render and persist.

Loading TodoMVC

To begin validating todo creation, direct the Playwright page to the hosted demo and define the sample todo data that the flow will reuse.

const TODO_ITEMS = [
 'buy some cheese',
version: 5.5.5
steps:
- prompt: launch a calculator
commands:
- command: exec
lang: shell
windows:
start /B calc.exe
timeout /t 5
- command: wait-for-text

We hope you appreciate your demo of TestDriver.ai made by Dashcam.io.

Follow the directiosn below to merge your demo into your repository

  1. Create a Dashcam account here
  2. Copy the API key from the team page
  3. Add the API key as as a GitHub secret called DASHCAM_WORKSPACE_API. Guide here.
  4. Copy the files from the PR to your repo. The paths are important!

All TestDriver VMs are ephemeral and will be destroyed after the test completes.

# Define the path for the required directory
$directoryPath = "$env:USERPROFILE\AppData\Roaming\Dashcam"
# List of files to be created
$files = @(
".replayable--mainwindow-ever-launched",
".replayable--has-accepted-tos",
".replayable--segment-done",
".replayable--ever-launched",
".replayable--do-not-update",
# Install the desktop app
# Configure log tracking: https://docs.dashcam.io/dashcam/configure/logs
npm install dashcam
dashcam auth ${{ secrets.DASHCAM_API_KEY }}
dashcam track --name=test --type=application --pattern="C:\Users\Switc\OneDrive\Desktop\*.log*"
dashcam start
Get-ChildItem C:\Windows\System32 | Tee-Object -FilePath 'C:\Users\Switc\OneDrive\Desktop\test.log'
# run the test
dashcam -t "My Test Result" -p --md
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"