適用於 Node.js 的新一代瀏覽器和行動裝置自動化測試框架
在真實環境中測試
WebdriverIO 讓您可以在使用者實際使用的瀏覽器或行動裝置中進行測試。
多功能且功能豐富
使用 WebdriverIO 在瀏覽器中進行完整的端對端測試或單元和元件測試。
自動等待
WebdriverIO 會自動等待元素出現後再與其互動。
import { $, expect } from '@wdio/globals'
import { render } from '@testing-library/vue'
import HelloWorld from '../../src/components/HelloWorld.vue'
describe('Component Testing', () => {
it('increments value on click', async () => {
const { getByText } = render(HelloWorld)
const btn = getByText('count is 0')
// transform into WebdriverIO element
const button = await $(btn)
// interact with element like a real user
await button.click()
await button.click()
await expect(button).toMatchInlineSnapshot(
"count is 2"
)
})
})
在幾秒鐘內開始使用 WebdriverIO
WebdriverIO 測試執行器配備一個命令列介面,提供強大的組態公用程式,並協助您在不到一分鐘的時間內建立測試設定。它讓您從可用的測試框架整合中選擇,並輕鬆新增所有支援的報告器和服務外掛!
只需一個簡單的命令,您就可以設定完整的測試套件
$ npm init wdio@latest ./
開始深入瞭解 WebdriverIO,以及如何開始使用在 YouTube 上的教學影片。
觀看有關 WebdriverIO 的演講
WebdriverIO 社群積極在各種使用者群組或會議上,針對使用 WebdriverIO 進行自動化測試的特定主題發表演講。請查看Julia Pottinger 在Open Quality Conference 上關於我最喜歡的 WebdriverIO 功能的演講。
還有許多 YouTube 頻道提供社群成員製作的實用教學影片,例如Klamping、Seventeenth Sep 或Automation Bro。
Google Lighthouse 整合
WebdriverIO 不僅根據 WebDriver 協定執行自動化,還利用原生瀏覽器 API 來啟用與熱門開發人員工具(例如 Chrome DevTools 或 Google Lighthouse)的整合。透過 @wdio/lighthouse-service
外掛程式,您可以存取用於驗證您的應用程式是否為有效的 PWA 應用程式的指令,以及用於擷取前端效能指標(例如 `speedIndex` 和其他指標)的指令。
await browser.emulateDevice('iPhone X')
await browser.enablePerformanceAudits({
networkThrottling: 'Good 3G',
cacheEnabled: true,
formFactor: 'mobile'
})
// open application under test
await browser.url('https://127.0.0.1:3000')
expect(await browser.getMetrics().firstMeaningfulPaint)
.toBeBelow(2500)
const pwaCheckResult = await browser.checkPWA()
expect(pwaCheckResult.passed).toBe(true)
開放原始碼和開放管理
我們是一個開放原始碼專案,致力於透明度和社群治理。我們是 OpenJS Foundation 的一部分,而 OpenJS Foundation 又是 Linux Foundation 的一部分。該專案完全由志工運行,並由希望該專案成功的投資公司資助。專案團隊感謝這些公司的慷慨贊助。
💎 高級贊助商
🥇 黃金贊助商
如果您在您的組織內使用 WebdriverIO,請考慮成為贊助商來支持該專案。這將有助於我們保持專案的運行和發展。