Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

feat: add WebdriverIO tests + dual workflow (tauri-driver + bb)

Louis Beaumont4bb1c8d5663d
diff --git a/.github/workflows/e2e-windows.yml b/.github/workflows/e2e-windows.yml
index a374acbff..e0a6c0411 100644
--- a/.github/workflows/e2e-windows.yml
+++ b/.github/workflows/e2e-windows.yml
@@ -13,22 +13,21 @@ on:
description: "Runner label (self-hosted runner name)"
required: false
default: "windows-desktop-test"
- fallback_to_hosted:
- description: "Fall back to GitHub-hosted runner if self-hosted unavailable"
+ skip_build:
+ description: "Skip build (self-hosted only, app already installed)"
type: boolean
- default: true
+ default: false
concurrency:
group: e2e-windows-${{ github.ref }}
- cancel-in-progress: false # don't cancel — these are slow and important
+ cancel-in-progress: false
jobs:
- # ── Self-hosted runner (primary) ────────────────────────────────────────────
+ # ── Self-hosted: bb + API tests on real desktop ──────────────────────────────
e2e-self-hosted:
name: Windows E2E (self-hosted)
runs-on: [self-hosted, "${{ inputs.runner || 'windows-desktop-test' }}"]
timeout-minutes: 30
- # Only run if release build succeeded (or manual dispatch)
if: >
github.event_name == 'workflow_dispatch' ||
github.event.workflow_run.conclusion == 'success'
@@ -57,16 +56,13 @@ jobs:
}
cd $bbDir
cargo build --release -p bb
- # Add to PATH for this job
$bbBin = "$bbDir\target\release"
echo $bbBin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- # Verify
& "$bbBin\bb.exe" --version
- name: Wait for screenpipe to be running
shell: pwsh
run: |
- # On self-hosted runner, screenpipe should already be running as startup item
$proc = Get-Process -Name "screenpipe*" -ErrorAction SilentlyContinue
if (-not $proc) {
echo "screenpipe not running, attempting to start..."
@@ -78,7 +74,6 @@ jobs:
echo "warning: could not find screenpipe executable"
}
}
- # Wait for health API
for ($i = 1; $i -le 30; $i++) {
try {
$response = Invoke-RestMethod -Uri "http://localhost:3030/health" -TimeoutSec 5
@@ -95,7 +90,7 @@ jobs:
with:
bun-version: latest
- - name: Run E2E tests
+ - name: Run bb + API E2E tests
id: e2e
shell: pwsh
env:
@@ -113,18 +108,15 @@ jobs:
${{ runner.temp }}\e2e-full.log
retention-days: 14
- # ── GitHub-hosted fallback ──────────────────────────────────────────────────
- # Runs API-only tests (no bb/UI automation) when self-hosted is unavailable
- e2e-hosted-fallback:
- name: Windows E2E (hosted fallback)
+ # ── GitHub-hosted: build app + tauri-driver WebdriverIO tests ────────────────
+ # Full DOM-level UI testing via tauri-driver (WebView2 WebDriver)
+ e2e-webdriver:
+ name: Windows E2E (WebDriver)
runs-on: windows-latest
- timeout-minutes: 45
- needs: e2e-self-hosted
+ timeout-minutes: 60
if: >
- always() &&
- needs.e2e-self-hosted.result == 'skipped' ||
- needs.e2e-self-hosted.result == 'failure' ||
- needs.e2e-self-hosted.result == 'cancelled'
+ github.event_name == 'workflow_dispatch' ||
+ github.event.workflow_run.conclusion == 'success'
steps:
- uses: actions/checkout@v4
@@ -176,10 +168,13 @@ jobs:
$service = Get-Service -Name audiosrv
if ($service.Status -ne 'Running') {
net start audiosrv
- } else {
- Write-Host "Audio service is already running"
}
+ - name: Install Rust
+ run: |
+ Invoke-WebRequest https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-gnu/rustup-init.exe -OutFile rustup-init.exe
+ .\rustup-init.exe -y
+
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
@@ -194,6 +189,15 @@ jobs:
with:
vcpkgGitCommitId: "7adc2e4d49e8d0efc07a369079faa6bc3dbb90f3"
+ - name: Install 7zip
+ shell: powershell
+ run: |
+ $7zipUrl = "https://7-zip.org/a/7z2301-x64.exe"
+ Invoke-WebRequest -Uri $7zipUrl -OutFile 7z-installer.exe
+ Start-Process -FilePath .\7z-installer.exe -Args "/S" -Wait
+ Remove-Item 7z-installer.exe
+ echo "C:\Program Files\7-Zip" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
with:
@@ -228,46 +232,90 @@ jobs:
New-Item -ItemType Directory -Force -Path $vcredist_dir | Out-Null
Copy-Item C:\Windows\System32\vcruntime140.dll -Destination $vcredist_dir -Force
- - name: Build screenpipe CLI
+ - name: Build CLI
shell: pwsh
env:
CARGO_PROFILE_RELEASE_STRIP: symbols
CARGO_PROFILE_RELEASE_PANIC: abort
+ CARGO_PROFILE_RELEASE_INCREMENTAL: false
run: cargo build --release -p screenpipe-server --target x86_64-pc-windows-msvc
- - name: Start screenpipe backend
+ - name: Install frontend dependencies
+ working-directory: ./apps/screenpipe-app-tauri
+ run: bun install
+
+ - name: Run pre_build.js
+ working-directory: ./apps/screenpipe-app-tauri
+ run: bun ./scripts/pre_build.js
+
+ - name: Build Tauri app
+ uses: tauri-apps/[email protected]
+ env:
+ CI: true
+ CARGO_PROFILE_RELEASE_LTO: thin
+ CARGO_PROFILE_RELEASE_OPT_LEVEL: 2
+ CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 16
+ CARGO_INCREMENTAL: true
+ CARGO_PROFILE_RELEASE_STRIP: symbols
+ CARGO_PROFILE_RELEASE_PANIC: abort
+ CARGO_PROFILE_RELEASE_INCREMENTAL: false
+ RUSTFLAGS: "-C target-feature=+crt-static -C link-arg=/LTCG"
+ VCPKG_STATIC_LINKAGE: "true"
+ KNF_STATIC_CRT: "1"
+ with:
+ args: "--target x86_64-pc-windows-msvc --no-bundle"
+ projectPath: "./apps/screenpipe-app-tauri"
+ tauriScript: bunx tauri -v
+
+ - name: Install tauri-driver
shell: pwsh
run: |
- $env:Path = "target\x86_64-pc-windows-msvc\release;$env:Path"
- Start-Process -FilePath "target\x86_64-pc-windows-msvc\release\screenpipe.exe" -WindowStyle Hidden
- # Wait for health
- for ($i = 1; $i -le 30; $i++) {
- try {
- Invoke-RestMethod -Uri "http://localhost:3030/health" -TimeoutSec 5
- Write-Host "health API ready"
- break
- } catch {
- Write-Host "waiting for health API... ($i/30)"
- Start-Sleep -Seconds 2
- }
+ if (-not (Test-Path "$env:USERPROFILE\.cargo\bin\tauri-driver.exe")) {
+ cargo install tauri-driver
}
- - name: Run API-only E2E tests
+ - name: Remove previous Edge WebDriver
shell: pwsh
- env:
- ARTIFACTS_DIR: ${{ runner.temp }}\e2e-artifacts
run: |
- # On hosted runner without bb, only run API tests
- bun .github/scripts/e2e/run-all.ts --suite api 2>&1 | Tee-Object -FilePath "${{ runner.temp }}\e2e-full.log"
- bun .github/scripts/e2e/run-all.ts --suite recording 2>&1 | Tee-Object -FilePath "${{ runner.temp }}\e2e-recording.log" -Append
+ $folderPath = "$($env:SystemDrive)\SeleniumWebDrivers\EdgeDriver"
+ if (Test-Path $folderPath) {
+ Remove-Item -Path $folderPath -Recurse -Force
+ }
- - name: Upload artifacts
+ - name: Download matching Edge WebDriver
+ continue-on-error: true
+ shell: pwsh
+ run: |
+ cd ./apps/screenpipe-app-tauri
+ $edgeVersion = (bun tauri info | Select-String 'WebView2').ToString().Split(':')[1].Trim()
+ Write-Output "Detected Edge version: $edgeVersion"
+ cd ..
+ $driverUrl = "https://msedgedriver.azureedge.net/$edgeVersion/edgedriver_win64.zip"
+ Invoke-WebRequest -Uri $driverUrl -OutFile edgedriver.zip
+ Expand-Archive edgedriver.zip -DestinationPath edgedriver
+ echo (Join-Path $PWD 'edgedriver') | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+
+ - name: Run WebDriver E2E Tests
+ continue-on-error: true
+ shell: pwsh
+ working-directory: ./apps/screenpipe-app-tauri
+ run: |
+ bun run test:e2e 2>&1 | Tee-Object -FilePath e2e_output.log
+
+ - name: Upload E2E Test Artifacts
+ uses: actions/upload-artifact@v4
if: always()
+ with:
+ name: e2e-windows-webdriver-${{ github.run_id }}
+ path: |
+ ./apps/screenpipe-app-tauri/e2e/videos/*
+ ./apps/screenpipe-app-tauri/e2e_output.log
+
+ - name: Upload Screenpipe data
uses: actions/upload-artifact@v4
+ if: always()
with:
- name: e2e-windows-hosted-${{ github.run_id }}
+ name: e2e-windows-screenpipe-data-${{ github.run_id }}
+ include-hidden-files: true
path: |
- ${{ runner.temp }}\e2e-artifacts\
- ${{ runner.temp }}\e2e-full.log
- ${{ runner.temp }}\e2e-recording.log
- retention-days: 14
+ ~/.screenpipe/*
diff --git a/apps/screenpipe-app-tauri/e2e/tests/app-lifecycle.js b/apps/screenpipe-app-tauri/e2e/tests/app-lifecycle.js
new file mode 100644
index 000000000..bf5f3c1c7
--- /dev/null
+++ b/apps/screenpipe-app-tauri/e2e/tests/app-lifecycle.js
@@ -0,0 +1,98 @@
+/**
+ * App Lifecycle Test
+ *
+ * Covers TESTING.md sections:
+ * - Section 8: App lifecycle & updates (clean quit, force quit recovery)
+ * - Section 9: Database & storage (concurrent DB access, UTF-8)
+ * - Section 14: Windows-specific (COM thread conflict)
+ *
+ * Tests app stability and basic lifecycle behavior.
+ */
+
+describe('App Lifecycle', () => {
+ before(async () => {
+ await browser.waitUntil(
+ async () => (await browser.execute(() => document.readyState)) === 'complete',
+ { timeout: 30000, timeoutMsg: 'app did not load' }
+ );
+ });
+
+ it('should load without unhandled errors', async () => {
+ await browser.pause(3000);
+
+ const bodyText = await browser.execute(() => document.body.innerText);
+ expect(bodyText).not.toContain('Unhandled Runtime Error');
+ expect(bodyText).not.toContain('Application error');
+ expect(bodyText).not.toContain('Something went wrong');
+ });
+
+ it('should not have console errors on startup', async () => {
+ const logs = await browser.getLogs('browser');
+ const severeErrors = logs.filter(log =>
+ log.level === 'SEVERE' &&
+ !log.message.includes('favicon') &&
+ !log.message.includes('DevTools')
+ );
+
+ if (severeErrors.length > 0) {
+ console.log('Console errors found:');
+ severeErrors.forEach(e => console.log(` ${e.message}`));
+ }
+
+ // Warn but don't fail — some console errors may be expected
+ // expect(severeErrors.length).toBe(0);
+ });
+
+ it('should handle UTF-8 content in search (Section 9)', async () => {
+ const result = await browser.execute(async () => {
+ try {
+ const res = await fetch('http://localhost:3030/search?q=%E4%B8%AD%E6%96%87&limit=1');
+ return { ok: res.ok, status: res.status };
+ } catch (e) {
+ return { ok: false, error: e.message };
+ }
+ });
+
+ // Should not crash on Unicode search
+ expect(result.status).not.toBe(500);
+ });
+
+ it('should have responsive UI after 10 seconds', async () => {
+ await browser.pause(10000);
+
+ // Verify DOM is still interactive
+ const canExecute = await browser.execute(() => {
+ return typeof document.querySelector === 'function';
+ });
+ expect(canExecute).toBe(true);
+
+ const ready = await browser.execute(() => document.readyState);
+ expect(ready).toBe('complete');
+ });
+
+ it('should have correct window dimensions', async () => {
+ const size = await browser.execute(() => ({
+ width: window.innerWidth,
+ height: window.innerHeight,
+ }));
+
+ // Window should be reasonably sized (not 0x0 or tiny)
+ expect(size.width).toBeGreaterThan(400);
+ expect(size.height).toBeGreaterThan(300);
+ });
+
+ it('should navigate between pages without crash', async () => {
+ // Try navigating to different routes
+ const routes = ['/', '/settings'];
+
+ for (const route of routes) {
+ await browser.execute((r) => {
+ window.location.href = r;
+ }, route);
+ await browser.pause(2000);
+
+ const ready = await browser.execute(() => document.readyState);
+ expect(ready).toBe('complete');
+ }
+ });
+});
diff --git a/apps/screenpipe-app-tauri/e2e/tests/onboarding-flow.js b/apps/screenpipe-app-tauri/e2e/tests/onboarding-flow.js
new file mode 100644
index 000000000..deb822a31
--- /dev/null
+++ b/apps/screenpipe-app-tauri/e2e/tests/onboarding-flow.js
@@ -0,0 +1,78 @@
+/**
+ * Onboarding Flow Test
+ *
+ * Covers TESTING.md section 11:
+ * - Fresh install flow
+ * - Skip onboarding
+ * - Onboarding window size (no overflow)
+ * - Auto-advance after engine starts
+ */
+
+describe('Onboarding Flow', () => {
+ before(async () => {
+ await browser.waitUntil(
+ async () => (await browser.execute(() => document.readyState)) === 'complete',
+ { timeout: 30000, timeoutMsg: 'app did not load' }
+ );
+ });
+
+ it('should show onboarding on fresh launch', async () => {
+ // On fresh app launch, onboarding should appear
+ // Look for skip button or onboarding-related content
+ await browser.pause(2000);
+
+ const bodyText = await browser.execute(() => document.body.innerText.toLowerCase());
+ const hasOnboarding = bodyText.includes('skip') ||
+ bodyText.includes('get started') ||
+ bodyText.includes('welcome') ||
+ bodyText.includes('setup') ||
+ bodyText.includes('next');
+ expect(hasOnboarding).toBe(true);
+ });
+
+ it('should have no overflow (window renders correctly)', async () => {
+ // Check that the body doesn't have horizontal overflow
+ const hasOverflow = await browser.execute(() => {
+ return document.body.scrollWidth > document.body.clientWidth + 10;
+ });
+ expect(hasOverflow).toBe(false);
+ });
+
+ it('should be able to skip onboarding', async () => {
+ // Find and click skip
+ try {
+ const skipBtn = await $('button*=skip');
+ await skipBtn.waitForDisplayed({ timeout: 5000 });
+ await skipBtn.click();
+ await browser.pause(1000);
+ } catch {
+ // Try JS click fallback
+ await browser.execute(() => {
+ const btns = document.querySelectorAll('button');
+ for (const btn of btns) {
+ if (btn.textContent.toLowerCase().includes('skip')) {
+ btn.click();
+ break;
+ }
+ }
+ });
+ await browser.pause(1000);
+ }
+
+ // After skipping, should reach main app view
+ const ready = await browser.execute(() => document.readyState);
+ expect(ready).toBe('complete');
+ });
+
+ it('should not crash after skipping', async () => {
+ // Wait a moment and verify app is stable
+ await browser.pause(3000);
+
+ const ready = await browser.execute(() => document.readyState);
+ expect(ready).toBe('complete');
+
+ const bodyText = await browser.execute(() => document.body.innerText);
+ expect(bodyText).not.toContain('Unhandled Runtime Error');
+ expect(bodyText).not.toContain('Application error');
+ });
+});
diff --git a/apps/screenpipe-app-tauri/e2e/tests/search-api.js b/apps/screenpipe-app-tauri/e2e/tests/search-api.js
new file mode 100644
index 000000000..f7c4881d8
--- /dev/null
+++ b/apps/screenpipe-app-tauri/e2e/tests/search-api.js
@@ -0,0 +1,110 @@
+/**
+ * Search & API Integration Test
+ *
+ * Covers TESTING.md sections:
+ * - Section 5: Frame comparison & OCR pipeline
+ * - Section 9: Database & storage
+ * - Section 12: Timeline & search
+ *
+ * Tests the REST API and search functionality end-to-end.
+ * These tests run inside the WebView2 context using fetch().
+ */
+
+describe('Search & API', () => {
+ const API_BASE = 'http://localhost:3030';
+
+ before(async () => {
+ await browser.waitUntil(
+ async () => (await browser.execute(() => document.readyState)) === 'complete',
+ { timeout: 30000, timeoutMsg: 'app did not load' }
+ );
+
+ // Skip onboarding
+ try {
+ const skipBtn = await $('button*=skip');
+ if (await skipBtn.isDisplayed()) {
+ await skipBtn.click();
+ await browser.pause(500);
+ }
+ } catch {}
+ try {
+ const closeBtn = await $('button svg.lucide-x');
+ if (await closeBtn.isDisplayed()) {
+ await closeBtn.closest('button').click();
+ await browser.pause(500);
+ }
+ } catch {}
+ });
+
+ it('should have healthy API', async () => {
+ const health = await browser.execute(async (base) => {
+ const res = await fetch(`${base}/health`);
+ return res.json();
+ }, API_BASE);
+
+ expect(health).toHaveProperty('status');
+ expect(health).toHaveProperty('frame_status');
+ expect(health).toHaveProperty('status_code');
+ });
+
+ it('should return OCR search results', async () => {
+ const data = await browser.execute(async (base) => {
+ const res = await fetch(`${base}/search?limit=5&content_type=ocr`);
+ return res.json();
+ }, API_BASE);
+
+ expect(data).toHaveProperty('data');
+ expect(Array.isArray(data.data)).toBe(true);
+ });
+
+ it('should return search results with query', async () => {
+ const data = await browser.execute(async (base) => {
+ const res = await fetch(`${base}/search?limit=5&q=test`);
+ return res.json();
+ }, API_BASE);
+
+ expect(data).toHaveProperty('data');
+ expect(data).toHaveProperty('pagination');
+ });
+
+ it('should handle search with date range', async () => {
+ const data = await browser.execute(async (base) => {
+ const today = new Date().toISOString().split('T')[0] + 'T00:00:00Z';
+ const res = await fetch(`${base}/search?limit=5&start_time=${today}`);
+ return { ok: res.ok, status: res.status };
+ }, API_BASE);
+
+ expect(data.ok).toBe(true);
+ });
+
+ it('should handle concurrent requests without errors', async () => {
+ const results = await browser.execute(async (base) => {
+ const promises = Array.from({ length: 5 }, () =>
+ fetch(`${base}/search?limit=1`).then(r => ({ ok: r.ok, status: r.status }))
+ );
+ return Promise.all(promises);
+ }, API_BASE);
+
+ const failures = results.filter(r => !r.ok);
+ expect(failures.length).toBe(0);
+ });
+
+ it('should not return 500 on invalid content_type', async () => {
+ const result = await browser.execute(async (base) => {
+ const res = await fetch(`${base}/search?content_type=invalid`);
+ return { status: res.status };
+ }, API_BASE);
+
+ expect(result.status).not.toBe(500);
+ });
+
+ it('should have pipes endpoint accessible', async () => {
+ const result = await browser.execute(async (base) => {
+ const res = await fetch(`${base}/pipes/list`);
+ return { status: res.status };
+ }, API_BASE);
+
+ // 200, 403, or 404 are fine — not 500
+ expect(result.status).not.toBe(500);
+ });
+});
diff --git a/apps/screenpipe-app-tauri/e2e/tests/settings-navigation.js b/apps/screenpipe-app-tauri/e2e/tests/settings-navigation.js
new file mode 100644
index 000000000..ca1a4fbd7
--- /dev/null
+++ b/apps/screenpipe-app-tauri/e2e/tests/settings-navigation.js
@@ -0,0 +1,104 @@
+/**
+ * Settings Navigation Test
+ *
+ * Covers TESTING.md sections:
+ * - Section 10: AI presets & settings (settings survive restart, overlay mode switch)
+ * - Section 14: Windows-specific (COM, DPI)
+ *
+ * Verifies all settings sections load and render correctly.
+ */
+
+describe('Settings Navigation', () => {
+ before(async () => {
+ await browser.waitUntil(
+ async () => (await browser.execute(() => document.readyState)) === 'complete',
+ { timeout: 30000, timeoutMsg: 'app did not load' }
+ );
+
+ // Skip onboarding if shown
+ try {
+ const skipBtn = await $('button*=skip');
+ if (await skipBtn.isDisplayed()) {
+ await skipBtn.click();
+ await browser.pause(500);
+ }
+ } catch {}
+
+ // Close any dialog
+ try {
+ const closeBtn = await $('button svg.lucide-x');
+ if (await closeBtn.isDisplayed()) {
+ await closeBtn.closest('button').click();
+ await browser.pause(500);
+ }
+ } catch {}
+ });
+
+ it('should open settings page', async () => {
+ // Navigate to settings via URL or menu
+ await browser.execute(() => {
+ window.location.href = '/settings';
+ });
+ await browser.pause(2000);
+
+ // Verify we're on settings
+ const url = await browser.getUrl();
+ expect(url).toContain('settings');
+ });
+
+ const sections = ['general', 'recording', 'ai', 'shortcuts', 'account', 'disk'];
+
+ for (const section of sections) {
+ it(`should load ${section} section`, async () => {
+ // Find and click the section link/button
+ try {
+ const link = await $(`a[href*="${section}"], button*=${section}`);
+ if (await link.isExisting()) {
+ await link.click();
+ await browser.pause(1000);
+ }
+ } catch {
+ // Section might be accessed via tab or different selector
+ await browser.execute((s) => {
+ const els = document.querySelectorAll('a, button');
+ for (const el of els) {
+ if (el.textContent.toLowerCase().includes(s)) {
+ el.click();
+ break;
+ }
+ }
+ }, section);
+ await browser.pause(1000);
+ }
+
+ // Page should not crash — check document is still complete
+ const ready = await browser.execute(() => document.readyState);
+ expect(ready).toBe('complete');
+
+ // No uncaught errors
+ const bodyText = await browser.execute(() => document.body.innerText);
+ expect(bodyText).not.toContain('Unhandled Runtime Error');
+ });
+ }
+
+ it('should have recording settings visible', async () => {
+ await browser.execute(() => {
+ const els = document.querySelectorAll('a, button');
+ for (const el of els) {
+ if (el.textContent.toLowerCase().includes('recording')) {
+ el.click();
+ break;
+ }
+ }
+ });
+ await browser.pause(1000);
+
+ // Should have FPS or capture-related settings
+ const pageText = await browser.execute(() => document.body.innerText.toLowerCase());
+ const hasRecordingSetting = pageText.includes('fps') ||
+ pageText.includes('capture') ||
+ pageText.includes('monitor') ||
+ pageText.includes('recording');
+ expect(hasRecordingSetting).toBe(true);
+ });
+});