Windows 環境測試 Safari 瀏覽器
只要透過 Playwright WebKit 瀏覽器套件,就能夠在 Windows 環境測試 WebKit(Safari 的引擎)的網頁相容性。
安裝步驟
- 安裝 Node.js
- 安裝 Playwright
npm init -y
npm install -D playwright
npx playwright install
建立測試腳本
建立檔案 test-webkit.js:
const { webkit } = require('playwright');
(async () => {
const browser = await webkit.launch({headless: false});
const page = await browser.newPage();
})();
執行測試
node test-webkit.js