Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

632 B
Raw Blame
import type { Page } from '@stablyai/playwright-test'

function xpathLiteral(value: string): string {
  if (!value.includes("'")) {
    return `'${value}'`
  }
  if (!value.includes('"')) {
    return `"${value}"`
  }
  return `concat(${value
    .split("'")
    .map((part) => `'${part}'`)
    .join(`, '"'", `)})`
}

export function worktreeRow(page: Page, worktreeId: string) {
  return page.locator(`xpath=//*[@data-worktree-id=${xpathLiteral(worktreeId)}]`).first()
}

export function worktreeRowSurface(page: Page, worktreeId: string) {
  return worktreeRow(page, worktreeId).locator('[data-worktree-card-surface]').first()
}