{"id":"0a2f9d84-03ac-4dca-92f3-a9a01d7d8ee1","shortId":"bdQcDt","kind":"skill","title":"azure-microsoft-playwright-testing-ts","tagline":"Run Playwright tests at scale with cloud-hosted browsers and integrated Azure portal reporting.","description":"# Azure Playwright Workspaces SDK for TypeScript\n\nRun Playwright tests at scale with cloud-hosted browsers and integrated Azure portal reporting.\n\n> **Migration Notice:** `@azure/microsoft-playwright-testing` is retired on **March 8, 2026**. Use `@azure/playwright` instead. See [migration guide](https://aka.ms/mpt/migration-guidance).\n\n## Installation\n\n```bash\n# Recommended: Auto-generates config\nnpm init @azure/playwright@latest\n\n# Manual installation\nnpm install @azure/playwright --save-dev\nnpm install @playwright/test@^1.47 --save-dev\nnpm install @azure/identity --save-dev\n```\n\n**Requirements:**\n- Playwright version 1.47+ (basic usage)\n- Playwright version 1.57+ (Azure reporter features)\n\n## Environment Variables\n\n```bash\nPLAYWRIGHT_SERVICE_URL=wss://eastus.api.playwright.microsoft.com/playwrightworkspaces/{workspace-id}/browsers\n```\n\n## Authentication\n\n### Microsoft Entra ID (Recommended)\n\n```bash\n# Sign in with Azure CLI\naz login\n```\n\n```typescript\n// playwright.service.config.ts\nimport { defineConfig } from \"@playwright/test\";\nimport { createAzurePlaywrightConfig, ServiceOS } from \"@azure/playwright\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\nimport config from \"./playwright.config\";\n\nexport default defineConfig(\n  config,\n  createAzurePlaywrightConfig(config, {\n    os: ServiceOS.LINUX,\n    credential: new DefaultAzureCredential(),\n  })\n);\n```\n\n### Custom Credential\n\n```typescript\nimport { ManagedIdentityCredential } from \"@azure/identity\";\nimport { createAzurePlaywrightConfig } from \"@azure/playwright\";\n\nexport default defineConfig(\n  config,\n  createAzurePlaywrightConfig(config, {\n    credential: new ManagedIdentityCredential(),\n  })\n);\n```\n\n## Core Workflow\n\n### Service Configuration\n\n```typescript\n// playwright.service.config.ts\nimport { defineConfig } from \"@playwright/test\";\nimport { createAzurePlaywrightConfig, ServiceOS } from \"@azure/playwright\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\nimport config from \"./playwright.config\";\n\nexport default defineConfig(\n  config,\n  createAzurePlaywrightConfig(config, {\n    os: ServiceOS.LINUX,\n    connectTimeout: 30000,\n    exposeNetwork: \"<loopback>\",\n    credential: new DefaultAzureCredential(),\n  })\n);\n```\n\n### Run Tests\n\n```bash\nnpx playwright test --config=playwright.service.config.ts --workers=20\n```\n\n### With Azure Reporter\n\n```typescript\nimport { defineConfig } from \"@playwright/test\";\nimport { createAzurePlaywrightConfig, ServiceOS } from \"@azure/playwright\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\nimport config from \"./playwright.config\";\n\nexport default defineConfig(\n  config,\n  createAzurePlaywrightConfig(config, {\n    os: ServiceOS.LINUX,\n    credential: new DefaultAzureCredential(),\n  }),\n  {\n    reporter: [\n      [\"html\", { open: \"never\" }],\n      [\"@azure/playwright/reporter\"],\n    ],\n  }\n);\n```\n\n### Manual Browser Connection\n\n```typescript\nimport playwright, { test, expect, BrowserType } from \"@playwright/test\";\nimport { getConnectOptions } from \"@azure/playwright\";\n\ntest(\"manual connection\", async ({ browserName }) => {\n  const { wsEndpoint, options } = await getConnectOptions();\n  const browser = await (playwright[browserName] as BrowserType).connect(wsEndpoint, options);\n  const context = await browser.newContext();\n  const page = await context.newPage();\n\n  await page.goto(\"https://example.com\");\n  await expect(page).toHaveTitle(/Example/);\n\n  await browser.close();\n});\n```\n\n## Configuration Options\n\n```typescript\ntype PlaywrightServiceAdditionalOptions = {\n  serviceAuthType?: \"ENTRA_ID\" | \"ACCESS_TOKEN\";  // Default: ENTRA_ID\n  os?: \"linux\" | \"windows\";                        // Default: linux\n  runName?: string;                                // Custom run name for portal\n  connectTimeout?: number;                         // Default: 30000ms\n  exposeNetwork?: string;                          // Default: <loopback>\n  credential?: TokenCredential;                    // REQUIRED for Entra ID\n};\n```\n\n### ServiceOS Enum\n\n```typescript\nimport { ServiceOS } from \"@azure/playwright\";\n\n// Available values\nServiceOS.LINUX   // \"linux\" - default\nServiceOS.WINDOWS // \"windows\"\n```\n\n### ServiceAuth Enum\n\n```typescript\nimport { ServiceAuth } from \"@azure/playwright\";\n\n// Available values\nServiceAuth.ENTRA_ID      // Recommended - uses credential\nServiceAuth.ACCESS_TOKEN  // Use PLAYWRIGHT_SERVICE_ACCESS_TOKEN env var\n```\n\n## CI/CD Integration\n\n### GitHub Actions\n\n```yaml\nname: playwright-ts\non: [push, pull_request]\n\npermissions:\n  id-token: write\n  contents: read\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Azure Login\n        uses: azure/login@v2\n        with:\n          client-id: ${{ secrets.AZURE_CLIENT_ID }}\n          tenant-id: ${{ secrets.AZURE_TENANT_ID }}\n          subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}\n\n      - run: npm ci\n      \n      - name: Run Tests\n        env:\n          PLAYWRIGHT_SERVICE_URL: ${{ secrets.PLAYWRIGHT_SERVICE_URL }}\n        run: npx playwright test -c playwright.service.config.ts --workers=20\n```\n\n### Azure Pipelines\n\n```yaml\n- task: AzureCLI@2\n  displayName: Run Playwright Tests\n  env:\n    PLAYWRIGHT_SERVICE_URL: $(PLAYWRIGHT_SERVICE_URL)\n  inputs:\n    azureSubscription: My_Service_Connection\n    scriptType: pscore\n    inlineScript: |\n      npx playwright test -c playwright.service.config.ts --workers=20\n    addSpnToEnvironment: true\n```\n\n## Key Types\n\n```typescript\nimport {\n  createAzurePlaywrightConfig,\n  getConnectOptions,\n  ServiceOS,\n  ServiceAuth,\n  ServiceEnvironmentVariable,\n} from \"@azure/playwright\";\n\nimport type {\n  OsType,\n  AuthenticationType,\n  BrowserConnectOptions,\n  PlaywrightServiceAdditionalOptions,\n} from \"@azure/playwright\";\n```\n\n## Migration from Old Package\n\n| Old (`@azure/microsoft-playwright-testing`) | New (`@azure/playwright`) |\n|---------------------------------------------|---------------------------|\n| `getServiceConfig()` | `createAzurePlaywrightConfig()` |\n| `timeout` option | `connectTimeout` option |\n| `runId` option | `runName` option |\n| `useCloudHostedBrowsers` option | Removed (always enabled) |\n| `@azure/microsoft-playwright-testing/reporter` | `@azure/playwright/reporter` |\n| Implicit credential | Explicit `credential` parameter |\n\n### Before (Old)\n\n```typescript\nimport { getServiceConfig, ServiceOS } from \"@azure/microsoft-playwright-testing\";\n\nexport default defineConfig(\n  config,\n  getServiceConfig(config, {\n    os: ServiceOS.LINUX,\n    timeout: 30000,\n    useCloudHostedBrowsers: true,\n  }),\n  {\n    reporter: [[\"@azure/microsoft-playwright-testing/reporter\"]],\n  }\n);\n```\n\n### After (New)\n\n```typescript\nimport { createAzurePlaywrightConfig, ServiceOS } from \"@azure/playwright\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nexport default defineConfig(\n  config,\n  createAzurePlaywrightConfig(config, {\n    os: ServiceOS.LINUX,\n    connectTimeout: 30000,\n    credential: new DefaultAzureCredential(),\n  }),\n  {\n    reporter: [\n      [\"html\", { open: \"never\" }],\n      [\"@azure/playwright/reporter\"],\n    ],\n  }\n);\n```\n\n## Best Practices\n\n1. **Use Entra ID auth** — More secure than access tokens\n2. **Provide explicit credential** — Always pass `credential: new DefaultAzureCredential()`\n3. **Enable artifacts** — Set `trace: \"on-first-retry\"`, `video: \"retain-on-failure\"` in config\n4. **Scale workers** — Use `--workers=20` or higher for parallel execution\n5. **Region selection** — Choose region closest to your test targets\n6. **HTML reporter first** — When using Azure reporter, list HTML reporter before Azure reporter\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.","tags":["azure","microsoft","playwright","testing","antigravity","awesome","skills","sickn33","agent-skills","agentic-skills","ai-agent-skills","ai-agents"],"capabilities":["skill","source-sickn33","skill-azure-microsoft-playwright-testing-ts","topic-agent-skills","topic-agentic-skills","topic-ai-agent-skills","topic-ai-agents","topic-ai-coding","topic-ai-workflows","topic-antigravity","topic-antigravity-skills","topic-claude-code","topic-claude-code-skills","topic-codex-cli","topic-codex-skills"],"categories":["antigravity-awesome-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/sickn33/antigravity-awesome-skills/azure-microsoft-playwright-testing-ts","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add sickn33/antigravity-awesome-skills","source_repo":"https://github.com/sickn33/antigravity-awesome-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 34928 github stars · SKILL.md body (8,041 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-24T18:50:32.422Z","embedding":null,"createdAt":"2026-04-18T21:32:49.552Z","updatedAt":"2026-04-24T18:50:32.422Z","lastSeenAt":"2026-04-24T18:50:32.422Z","tsv":"'/browsers':117 '/example':315 '/mpt/migration-guidance).':60 '/playwright.config':149,203,248 '/playwrightworkspaces/':113 '1':608 '1.47':83,96 '1.57':101 '2':476,618 '20':227,470,502,648 '2026':51 '3':627 '30000':213,571,597 '30000ms':346 '4':643 '5':654 '6':664 '8':50 'access':326,389,616 'action':396,690 'actions/checkout':423 'addspntoenviron':503 'aka.ms':59 'aka.ms/mpt/migration-guidance).':58 'alway':545,622 'applic':684 'artifact':629 'ask':728 'async':283 'auth':612 'authent':118 'authenticationtyp':519 'auto':65 'auto-gener':64 'avail':363,377 'await':288,292,302,306,308,311,316 'az':129 'azur':2,19,22,40,102,127,229,426,471,670,676 'azure-microsoft-playwright-testing-t':1 'azure/identity':89,145,167,199,244,587 'azure/login':429 'azure/microsoft-playwright-testing':45,529,561 'azure/microsoft-playwright-testing/reporter':547,575 'azure/playwright':53,70,76,141,171,195,240,279,362,376,515,523,531,583 'azure/playwright/reporter':264,548,605 'azurec':475 'azuresubscript':489 'bash':62,107,123,220 'basic':97 'best':606 'boundari':736 'browser':16,37,266,291 'browser.close':317 'browser.newcontext':303 'browserconnectopt':520 'browsernam':284,294 'browsertyp':273,296 'c':467,499 'choos':657 'ci':452 'ci/cd':393 'clarif':730 'clear':703 'cli':128 'client':433,436 'client-id':432 'closest':659 'cloud':14,35 'cloud-host':13,34 'config':67,147,153,155,175,177,201,207,209,224,246,252,254,565,567,591,593,642 'configur':184,318 'connect':267,282,297,492 'connecttimeout':212,343,536,596 'const':285,290,300,304 'content':411 'context':301 'context.newpage':307 'core':181 'createazureplaywrightconfig':138,154,169,176,192,208,237,253,509,533,580,592 'credenti':158,162,178,215,257,350,383,550,552,598,621,624 'criteria':739 'custom':161,338 'default':151,173,205,250,328,334,345,349,367,563,589 'defaultazurecredenti':143,160,197,217,242,259,585,600,626 'defineconfig':134,152,174,188,206,233,251,564,590 'describ':691,707 'dev':79,86,92 'displaynam':477 'eastus.api.playwright.microsoft.com':112 'eastus.api.playwright.microsoft.com/playwrightworkspaces/':111 'enabl':546,628 'entra':120,324,329,354,610 'enum':357,371 'env':391,456,481 'environ':105,719 'environment-specif':718 'example.com':310 'execut':653,686 'expect':272,312 'expert':724 'explicit':551,620 'export':150,172,204,249,562,588 'exposenetwork':214,347 'failur':640 'featur':104 'first':634,667 'generat':66 'getconnectopt':277,289,510 'getserviceconfig':532,558,566 'github':395 'guid':57 'higher':650 'host':15,36 'html':261,602,665,673 'id':116,121,325,330,355,380,408,434,437,440,443,446,449,611 'id-token':407 'implicit':549 'import':133,137,142,146,164,168,187,191,196,200,232,236,241,245,269,276,359,373,508,516,557,579,584 'init':69 'inlinescript':495 'input':488,733 'instal':61,73,75,81,88 'instead':54 'integr':18,39,394 'job':413 'key':505 'latest':71,420 'limit':695 'linux':332,335,366 'list':672 'login':130,427 'managedidentitycredenti':165,180 'manual':72,265,281 'march':49 'match':704 'microsoft':3,119 'migrat':43,56,524 'miss':741 'name':340,398,425,453 'never':263,604 'new':159,179,216,258,530,577,599,625 'notic':44 'npm':68,74,80,87,451 'npx':221,464,496 'number':344 'old':526,528,555 'on-first-retri':632 'open':262,603 'option':287,299,319,535,537,539,541,543 'os':156,210,255,331,568,594 'ostyp':518 'output':713 'overview':694 'packag':527 'page':305,313 'page.goto':309 'parallel':652 'paramet':553 'pass':623 'permiss':406,734 'pipelin':472 'playwright':4,8,23,29,94,99,108,222,270,293,387,400,457,465,479,482,485,497 'playwright-t':399 'playwright.service.config.ts':132,186,225,468,500 'playwright/test':82,136,190,235,275 'playwrightserviceadditionalopt':322,521 'portal':20,41,342 'practic':607 'provid':619 'pscore':494 'pull':404 'push':403 'read':412 'recommend':63,122,381 'region':655,658 'remov':544 'report':21,42,103,230,260,574,601,666,671,674,677 'request':405 'requir':93,352,732 'retain':638 'retain-on-failur':637 'retir':47 'retri':635 'review':725 'run':7,28,218,339,416,450,454,463,478 'runid':538 'runnam':336,540 'runs-on':415 'safeti':735 'save':78,85,91 'save-dev':77,84,90 'scale':11,32,644 'scope':706 'scripttyp':493 'sdk':25 'secrets.azure':435,441,447 'secrets.playwright':460 'secur':614 'see':55 'select':656 'servic':109,183,388,458,461,483,486,491 'serviceauth':370,374,512 'serviceauth.access':384 'serviceauth.entra':379 'serviceauthtyp':323 'serviceenvironmentvari':513 'serviceo':139,193,238,356,360,511,559,581 'serviceos.linux':157,211,256,365,569,595 'serviceos.windows':368 'set':630 'sign':124 'skill':682,698 'skill-azure-microsoft-playwright-testing-ts' 'source-sickn33' 'specif':720 'step':421 'stop':726 'string':337,348 'subscript':445,448 'subscription-id':444 'substitut':716 'success':738 'target':663 'task':474,702 'tenant':439,442 'tenant-id':438 'test':5,9,30,219,223,271,280,414,455,466,480,498,662,722 'timeout':534,570 'tohavetitl':314 'token':327,385,390,409,617 'tokencredenti':351 'topic-agent-skills' 'topic-agentic-skills' 'topic-ai-agent-skills' 'topic-ai-agents' 'topic-ai-coding' 'topic-ai-workflows' 'topic-antigravity' 'topic-antigravity-skills' 'topic-claude-code' 'topic-claude-code-skills' 'topic-codex-cli' 'topic-codex-skills' 'trace':631 'treat':711 'true':504,573 'ts':6,401 'type':321,506,517 'typescript':27,131,163,185,231,268,320,358,372,507,556,578 'ubuntu':419 'ubuntu-latest':418 'url':110,459,462,484,487 'usag':98 'use':52,382,386,422,428,609,646,669,680,696 'usecloudhostedbrows':542,572 'v2':430 'v4':424 'valid':721 'valu':364,378 'var':392 'variabl':106 'version':95,100 'video':636 'window':333,369 'worker':226,469,501,645,647 'workflow':182,688 'workspac':24,115 'workspace-id':114 'write':410 'wsendpoint':286,298 'yaml':397,473","prices":[{"id":"eea229eb-6b8f-4570-a8f7-6cefb0aea743","listingId":"0a2f9d84-03ac-4dca-92f3-a9a01d7d8ee1","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"sickn33","category":"antigravity-awesome-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T21:32:49.552Z"}],"sources":[{"listingId":"0a2f9d84-03ac-4dca-92f3-a9a01d7d8ee1","source":"github","sourceId":"sickn33/antigravity-awesome-skills/azure-microsoft-playwright-testing-ts","sourceUrl":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-microsoft-playwright-testing-ts","isPrimary":false,"firstSeenAt":"2026-04-18T21:32:49.552Z","lastSeenAt":"2026-04-24T18:50:32.422Z"}],"details":{"listingId":"0a2f9d84-03ac-4dca-92f3-a9a01d7d8ee1","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sickn33","slug":"azure-microsoft-playwright-testing-ts","github":{"repo":"sickn33/antigravity-awesome-skills","stars":34928,"topics":["agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows","antigravity","antigravity-skills","claude-code","claude-code-skills","codex-cli","codex-skills","cursor","cursor-skills","developer-tools","gemini-cli","gemini-skills","kiro","mcp","skill-library"],"license":"mit","html_url":"https://github.com/sickn33/antigravity-awesome-skills","pushed_at":"2026-04-24T06:41:17Z","description":"Installable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.","skill_md_sha":"a0f9dc73b4261ea59a91eea8b9ca444d1ea6453d","skill_md_path":"skills/azure-microsoft-playwright-testing-ts/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-microsoft-playwright-testing-ts"},"layout":"multi","source":"github","category":"antigravity-awesome-skills","frontmatter":{"name":"azure-microsoft-playwright-testing-ts","description":"Run Playwright tests at scale with cloud-hosted browsers and integrated Azure portal reporting."},"skills_sh_url":"https://skills.sh/sickn33/antigravity-awesome-skills/azure-microsoft-playwright-testing-ts"},"updatedAt":"2026-04-24T18:50:32.422Z"}}