Slide 21
Slide 21 text
Takas(@DevTakas)
Microsoft Playwright Testingを使ってみよう(2022.10 .NETラボ)
MPTを利用するように設定
3. Microsoft Playwright Testingを使ってみよう(デモ)
import { defineConfig, devices } from '@playwright/test’;
…
process.env.PLAYWRIGHT_SERVICE_RUN_ID = process.env.PLAYWRIGHT_SERVICE_RUN_ID || new Date().toISOString();
…
export default defineConfig(config, {
workers: 20,
…
use: {
connectOptions: {
wsEndpoint: `?cap=${JSON.stringify({
os, //‘linux‘か’windows‘を選択可能
runId: process.env.PLAYWRIGHT_SERVICE_RUN_ID
})}`,
timeout: 30000,
headers: {
‘x-mpt-access-key’:
},
exposeNetwork: ‘‘//localhostなどFWの内部で実行したい場合ここに色々設定する
}
…
},
});