Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
chore: add copilot setup boilerplates (#38037)
Pavel Feldman5b04cf56c417
diff --git a/examples/todomvc/.github/workflows/copilot-setup-steps.yml b/examples/todomvc/.github/workflows/copilot-setup-steps.ymlnew file mode 100644index 0000000000..d9b5b711e6--- /dev/null+++ b/examples/todomvc/.github/workflows/copilot-setup-steps.yml@@ -0,0 +1,34 @@+name: "Copilot Setup Steps"++on:+ workflow_dispatch:+ push:+ paths:+ - .github/workflows/copilot-setup-steps.yml+ pull_request:+ paths:+ - .github/workflows/copilot-setup-steps.yml++jobs:+ copilot-setup-steps:+ runs-on: ubuntu-latest++ permissions:+ contents: read++ steps:+ - uses: actions/checkout@v4++ - uses: actions/setup-node@v4+ with:+ node-version: lts/*++ - name: Install dependencies+ run: npm ci++ - name: Install Playwright Browsers+ run: npx playwright install --with-deps++ # Customize this step as needed+ - name: Build application+ run: npx run builddiff --git a/packages/playwright/src/agents/copilot-setup-steps.yml b/packages/playwright/src/agents/copilot-setup-steps.ymlnew file mode 100644index 0000000000..d9b5b711e6--- /dev/null+++ b/packages/playwright/src/agents/copilot-setup-steps.yml@@ -0,0 +1,34 @@+name: "Copilot Setup Steps"++on:+ workflow_dispatch:+ push:+ paths:+ - .github/workflows/copilot-setup-steps.yml+ pull_request:+ paths:+ - .github/workflows/copilot-setup-steps.yml++jobs:+ copilot-setup-steps:+ runs-on: ubuntu-latest++ permissions:+ contents: read++ steps:+ - uses: actions/checkout@v4++ - uses: actions/setup-node@v4+ with:+ node-version: lts/*++ - name: Install dependencies+ run: npm ci++ - name: Install Playwright Browsers+ run: npx playwright install --with-deps++ # Customize this step as needed+ - name: Build application+ run: npx run builddiff --git a/packages/playwright/src/agents/generateAgents.ts b/packages/playwright/src/agents/generateAgents.tsindex 92482efe5f..6271fe9f0e 100644--- a/packages/playwright/src/agents/generateAgents.ts+++ b/packages/playwright/src/agents/generateAgents.ts@@ -253,6 +253,36 @@ export class CopilotGenerator {await deleteFile(`.github/chatmodes/🎭 healer.chatmode.md`, 'legacy healer chatmode');await VSCodeGenerator.appendToMCPJson();+ const cwdFolder = path.basename(process.cwd());++ const mcpConfig = {+ 'mcpServers': {+ 'playwright-test': {+ 'type': 'stdio',+ 'command': 'npx',+ 'args': [+ `--prefix=/home/runner/work/${cwdFolder}/${cwdFolder}`,+ 'playwright',+ 'run-test-mcp-server',+ '--headless',+ `--config=/home/runner/work/${cwdFolder}/${cwdFolder}`+ ],+ 'tools': ['*']+ }+ }+ };++ if (!fs.existsSync('.github/copilot-setup-steps.yml')) {+ const yaml = fs.readFileSync(path.join(__dirname, 'copilot-setup-steps.yml'), 'utf-8');+ await writeFile('.github/workflows/copilot-setup-steps.yml', yaml, '🔧', 'GitHub Copilot setup steps');+ }++ console.log('');+ console.log('');+ console.log(' 🔧 TODO: GitHub > Settings > Copilot > Coding agent > MCP configuration');+ console.log('------------------------------------------------------------------');+ console.log(JSON.stringify(mcpConfig, null, 2));+ console.log('------------------------------------------------------------------');initRepoDone();}diff --git a/utils/build/build.js b/utils/build/build.jsindex 3ec5981c92..e753189262 100644--- a/utils/build/build.js+++ b/utils/build/build.js@@ -631,6 +631,12 @@ copyFiles.push({to: 'packages/playwright/lib',});+copyFiles.push({+ files: 'packages/playwright/src/agents/*.yml',+ from: 'packages/playwright/src',+ to: 'packages/playwright/lib',+});+if (watchMode) {// Run TypeScript for type checking.steps.push(new ProgramStep({