시작하기

YAML 파일로 시나리오를 정의하고, AI 없이 로컬 또는 GitHub Actions에서 E2E 테스트를 실행합니다.

YAML 시나리오란

@ohah/react-native-mcp-server/test가 지원하는 형식: platform, config, setup / steps / teardown 이 있는 한 파일. tap, assertText, waitForText 등 MCP 도구가 시나리오 스텝으로 실행됩니다.

기본 구조

name: 시나리오 이름
config:
  platform: ios # ios | android
  timeout: 10000 # 스텝당 타임아웃(ms)
  bundleId: org.example.app

setup:
  - launch: org.example.app
  - waitForVisible:
      selector: '#main-screen'

steps:
  - assertText:
      text: 'Count: 0'
      selector: '#counter'
  - tap:
      selector: '#increment-btn'
  - waitForText:
      text: 'Count: 1'
      timeout: 3000

teardown:
  - terminate: org.example.app
  • config: 플랫폼, 타임아웃, bundleId
  • setup: 앱 실행, 요소 대기 등
  • steps: tap, 입력, 검증, 스크린샷
  • teardown: 예: 앱 종료

자주 쓰는 스텝

Step용도
launch앱 실행 (bundleId)
terminate앱 종료
tap셀렉터에 해당하는 요소 탭
assertText셀렉터 위치 텍스트 검증
waitForText텍스트가 나올 때까지 대기
waitForVisible셀렉터가 보일 때까지 대기
screenshot스크린샷 저장 (path)

셀렉터는 앱의 testID#testID 형태로 쓰면 됩니다.

예: 버튼 탭 후 Count 검증

name: Press Counter tap
config:
  platform: ios
  timeout: 10000
  bundleId: org.reactnativemcp.demo

setup:
  - launch: org.reactnativemcp.demo
  - waitForVisible:
      selector: '#press-counter-button'

steps:
  - assertText:
      text: 'Count: 0'
      selector: '#press-counter-button'
  - tap:
      selector: '#press-counter-button'
  - waitForText:
      text: 'Count: 1'
      timeout: 3000
  - tap:
      selector: '#press-counter-button'
  - assertText:
      text: 'Count: 2'
      selector: '#press-counter-button'
  - screenshot:
      path: './results/counter.png'

teardown:
  - terminate: org.reactnativemcp.demo

실행 방법

  1. MCP 서버 빌드: bun run build
  2. 앱이 실행 중이거나 시나리오 setup에서 launch 사용
  3. 테스트 러너 실행, 예:
bun run test:yaml

또는 YAML 경로를 지정해 @ohah/react-native-mcp-server/testrun 스크립트 사용. 전체 문법은 E2E YAML 레퍼런스, 결과 확인은 E2E 대시보드, CI는 E2E on GitHub Actions 참고.