mobilewright

Mobilewright 是一個用於行動應用程式測試與自動化的開發框架。它允許透過單一 API 在真實裝置、模擬器與模擬器上測試 iOS/Android 應用程式。

mobilewright 是什麼?

Mobilewright 是一個用於行動應用程式測試與自動化的開發框架。它允許透過單一 API 在真實裝置、模擬器與模擬器上測試 iOS/Android 應用程式。

mobilewright 概覽

這是什麼

Mobilewright 是一個用於行動應用程式測試與自動化的開發框架。它允許透過單一 API 測試 iOS/Android 應用程式,支援實體裝置、模擬器與模擬器。其設計靈感來自 Playwright 的架構與開發者體驗。

主要功能

  • Playwright 風格的 API — screen.getByRole('button').tap(),就像 page.getByRole('button').click()
  • 零設定 — 自動偵測已啟動的模擬器 - 跨平台 — 統一的 iOS 與 Android 介面 - 自動等待 — 動作會等待元素可見、啟用且穩定後才進行互動 - 可鏈結的定位器 — screen.getByType('Cell').getByLabel('Item 1')
  • 重試斷言 — expect(locator).toBeVisible() 會持續輪詢直到滿足條件或超時 - 遠端支援 — 連接到另一台機器上的 mobilecli,適用於裝置實驗室設定 - 測試固定裝置 — @mobilewright/test 擴充 Playwright Test,提供 screen 與 device 固定裝置

使用情境

  • 在實體裝置、模擬器與模擬器上測試 iOS 與 Android 應用程式 - 透過無障礙樹(無需視覺模型)讓 AI 代理控制行動裝置 - 與 mobile-mcp、Claude、Cursor 或任何程式碼代理整合 - 透過遠端 mobilecli 連線進行裝置實驗室設定

快速開始

bash npm install mobilewright @mobilewright/test npx mobilewright init typescript import { test, expect } from '@mobilewright/test'; test('can sign in', async ({ screen }) => { await screen.getByLabel('Email').fill('[email protected]'); await screen.getByLabel('Password').fill('password123'); await screen.getByRole('button', { name: 'Sign In' }).tap(); await expect(screen.getByText('Welcome back')).toBeVisible(); }); bash npx mobilewright test

授權與價格

授權:Apache-2.0。價格:開放原始碼(免費)。

內容整理自該專案公開的 README 與儲存庫資訊。

將此徽章加入你的 README

Featured on YunoDB 徽章樣式與說明

你是這個專案的維護者嗎?展示它已收錄於 YunoDB。

Markdown[![Featured on YunoDB](https://yunodb.com/badge/mobile-nextmobilewright.svg)](https://yunodb.com/tools/mobile-nextmobilewright?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/mobile-nextmobilewright?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/mobile-nextmobilewright.svg" alt="Featured on YunoDB" height="20"></a>