OpenParable
Skip to content
← Back to skills

Keybase E2e Tests

Testing & Quality
keybase-e2e-tests

Keybase E2e Tests is an Agent Skill for testing & quality published in the keybase/client repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Use when writing, fixing, or adding e2e flow tests for the Keybase app — desktop (Playwright) or iOS (Maestro). Covers testID conventions, navigation patterns, common pitfalls, and the two-harness structure.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/keybase/client/blob/HEAD/skill/keybase-e2e-tests/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/keybase-e2e-tests, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Keybase E2E Flow Tests

Overview

Two harnesses, one shared testID registry. Always implement Electron + iOS for each bucket together (pairing rule in plans/flow-test.md).

Shared testID Registry

shared/tests/e2e/shared/test-ids.ts — single source of truth for all testID values.

Adding a testID to a component:

import * as TestIDs from '@/tests/e2e/shared/test-ids'
// ...
<Kb.ScrollView testID={TestIDs.SETTINGS_ADVANCED}>

Rule: Add testID prop to an already-existing element (input, scroll view, pre-existing wrapper). Never add a new container just to attach a testID.

Desktop — Playwright

WhatWhere
Test filesshared/tests/e2e/electron/flows/*.test.ts
Nav helpersshared/tests/e2e/electron/helpers/navigate.ts
Run allyarn test:e2e:desktop
Run branchyarn test:e2e:desktop:branch

Navigation helpers: navigateToChat, navigateToFiles, navigateToTeams, navigateToGit, navigateToSettings, navigateToPeople, navigateToCrypto, navigateToDevices

Common pitfall — hidden nav stack elements: React Navigation keeps prior screens mounted but hidden. getByTestId(X) may match 2+ elements (one hidden, one visible), causing Playwright strict-mode failures. Fix: use a selector unique to the destination screen rather than one shared with the source screen. Example: after navigating into a Files subfolder, the root screen's files-browser is still in the DOM but hidden — check for the Filter textbox instead, which only exists in subfolder views.

iOS — Appium + WebdriverIO (TypeScript)

WhatWhere
Flow filesshared/tests/e2e/ios-appium/flows/*.test.ts
Helpersshared/tests/e2e/ios-appium/helpers/ (elements, navigate, app)
Aggregate specshared/tests/e2e/ios-appium/all.test.ts (imports all flows → ONE session)
Configshared/tests/e2e/ios-appium/wdio.conf.ts
Run both devicesKB_SMOKE_USER=<user> yarn test:e2e:ios (iPhoneTest + iPadTest in PARALLEL; app installed on both)
Run one deviceKB_SMOKE_USER=<user> yarn test:e2e:ios:iphone / yarn test:e2e:ios:ipad (serial runner, shuts down other sims)
Reportyarn test:e2e:ios:report (reads ONLY tests/results/ios-appium-debug-{iphone,ipad}; each run overwrites its device's dir; per-image timestamps show when each device last ran)

Drives the already-installed app black-box (no rebuild). Selectors: ~<testID> (testID → iOS accessibilityIdentifier). Helpers: el/els/waitForTestID/countTestID/byText/tab (elements), escapeToTabs/goBack/navigateTo*/scrollDownToText (navigate). escapeToTabs runs before every test (resets to the tab root).

Gotchas (hard-won — read before adding flows):

  • Native tab bar: tap tabs by label (tab('People') → ~People), NOT nav-tab-* testIDs — those don't reach the native UITabBar.
  • Container testIDs (a flex Kb.Box2 wrapping a list) report visible="false" to XCUITest even when on screen → use waitForTestID (it uses waitForExist, presence), never toBeDisplayed.
  • testIDs must be on the MOBILE-rendered element. Many components branch on isMobile/.desktop/.native; a desktop-only testID is invisible on iOS (see [[project_e2e_testid_mobile_branch]]). Put the testID on the clickable/leaf element (e.g. Kb.ListItem's testID, a ClickableBox), not a non-clickable wrapping Box2 — wdio .click() no-ops on a non-accessible container.
  • byText uses CONTAINS — tappable rows have merged accessibility labels (e.g. ", Crypto"), so exact match fails.
  • Kb.Tabs supports a per-tab testID (needed for icon-only tabs like the team Settings gear). The app remembers the last-selected team tab → select tabs by testID, don't assume the default.
  • Modals: dismiss via Done/Close/Cancel (escapeToTabs does this first, before back buttons — a modal's back button is a no-op that loops).
  • HMR applies testID/component changes to the running sim app — no manual reload needed when adding testIDs.
  • Wait for a real data row (not just the list container) before asserting/screenshotting, so shots show loaded content.

iOS tab structure: People & Teams are direct tabs; Chat & Files have their own nav helpers; Crypto/Devices/Git/Settings live under the More tab (navigateToMore).

Plan

plans/flow-test.md — bucket checklist ordered easiest-first. Work one bucket at a time, both platforms together.