QE Blocks Tests V2 MCP Guide

Playwright E2E tests with mandatory @qe/blocks integration, including transformation of existing tests and BLAW-specific helpers.

Overview

The QE Blocks Tests V2 MCP generates Playwright tests that use the @qe/blocks package: reusable testing utilities built for Bloomberg Law products with built-in retry logic, performance logging, and product-specific functions. All generated tests use Blocks fixtures and the assistant automatically transforms raw Playwright patterns to their Blocks equivalents.

Use this MCP when you are working on Bloomberg Law products, when your repo already uses @qe/blocks, or when you want to transform existing Playwright tests to use Blocks patterns. For standard @playwright/test (non-Blocks), use QE E2E Tests V2.

URLs and JSON

Mount: /mcp/v2/blocks. Config key: qe_blocks_tests_v2. Legacy V1 mounts under /mcp/qe_blocks_tests (including older BBVPN V1 URLs) are deprecated — use V2 only.

EnvironmentURLTransportStatus
Development (V2) https://qe-mcp.bindg.com/mcp/v2/blocks http V2
Production (V2) https://qe-mcp.bindg.com/mcp/v2/blocks http Production

Cursor — ~/.cursor/mcp.json

{
  "mcpServers": {
    "qe_blocks_tests_v2": {
      "url": "https://qe-mcp.bindg.com/mcp/v2/blocks",
      "transport": "http"
    }
  }
}

VS Code — .vscode/mcp.json

{
  "servers": {
    "qe_blocks_tests_v2": {
      "url": "https://qe-mcp.bindg.com/mcp/v2/blocks",
      "type": "http"
    }
  },
  "inputs": []
}

Tools

ToolWhat it does
blocks_core Blocks-first UI tests: Artifactory setup, repo analysis, @qe/blocks/new-fixtures, non-destructive generation.
blocks_transform Converts plain Playwright UI code to @qe/blocks (import swaps, bl fixture, mapping tables). Pair with blocks_core.
blaw_product_context BLAW product grounding (Search, UDV, Dockets, Alerts, etc.). Pair with Blocks tools.

Add to Cursor

  1. Open Cursor and go to Settings.
  2. Find Tools & MCP and choose New MCP Server.
  3. Paste the Cursor JSON above (or a single entry).
  4. Save.
  5. Look at Installed MCP Servers to confirm the server is connected.

Add to VS Code

  1. Open VS Code, then the Command Palette.
  2. Search for MCP: Add Server and select HTTP.
  3. Enter the URL https://qe-mcp.bindg.com/mcp/v2/blocks.
  4. Provide an alias name such as qe_blocks_tests_v2.
  5. Save globally or to the workspace, then start the server.

@qe/blocks package setup

Before using this MCP, ensure @qe/blocks is installed:

npm install @qe/blocks

The package is available from Artifactory. Add the registry to .npmrc:

registry=https://artifactory.bna.com/artifactory/api/npm/npm-virtual/

Blocks fixtures usage

All generated UI tests use Blocks fixtures with a bl parameter:

import { test, expect } from '@qe/blocks/new-fixtures';

test('example', async ({ bl }) => {
  await bl.goto('/page');
  await bl.click('[data-testid="button"]');
  await bl.verifyElements('[data-testid="element"]');
});

Mandatory transformation rules

The MCP automatically transforms raw Playwright patterns to Blocks equivalents:

Raw PlaywrightBlocks equivalent
page.goto(url)bl.goto(url) — never use page.goto()
page.locator(sel).click()bl.click(sel)
page.locator(sel).fill(val)bl.inputText(sel, val)
expect(loc).toBeVisible()bl.verifyElements(sel)
expect(loc).toContainText(t)bl.containsText(sel, t)
import { test, expect } from '@playwright/test'import { test, expect } from '@qe/blocks/new-fixtures'

BLAW-specific Blocks functions

For Bloomberg Law products, the MCP can use specialized Blocks namespaces:

NamespaceImportSample functions
BlawBlocks import { BlawBlocks } from '@qe/blocks/blawblocks' addRootPermission(), addSinglePermission(perm), openDocument(docID)
BlawAlertsBlocks import { BlawAlertsBlocks } from '@qe/blocks/blawalertsblocks' createAlertswithKeyword(name, url, keyword), deleteAlerts()
DocketsBlocks import { DocketsBlocks } from '@qe/blocks/docketsblocks' openDocketsSearch(), selectCourtFilter(court), docketTracking(docID)
ContractsBlocks import { ContractsBlocks } from '@qe/blocks/contractsblocks' contractUpload(document), contractDelete(), addTemplate()

Generation workflow

1. Repository analysis

2. Test architecture proposal

3. Test generation (non-destructive)

Key principles

The MCP behaves like a senior Playwright architect. Key principles, condensed:

1. AI-powered senior Playwright architect persona

Deep expertise in TS/JS (ESM), API testing with Swagger/OpenAPI, web UI patterns, Playwright best practices, software quality standards, and @qe/blocks.

2. Mandatory @qe/blocks integration

All tests use Blocks fixtures and methods automatically, giving you retry logic, better errors, performance logging, and specialized BLAW functions for free.

3. Intelligent repository analysis

Detects framework, backend API structure, routing, state, build config, and existing test infrastructure before generating anything.

4. Automatic Blocks transformation

All raw Playwright patterns are transformed to Blocks equivalents during generation — no chance to accidentally use the less reliable raw patterns.

5. Comprehensive test coverage

Tests are generated for every identified core feature: happy path, negative scenarios, edge cases, and error handling. The rules explicitly prohibit shallow coverage.

6. Semantic selector strategy

Priority order: data-testid, role locators, getByText, getByLabel, getByPlaceholder, CSS only as a last resort. No nth-child.

7. Test type confirmation (UI / API / Hybrid)

The MCP asks the user to confirm UI, API, or Hybrid before generating, so requests like "test authentication" don't get the wrong interpretation.

8. Language and module-system detection

Detects TypeScript vs JavaScript and ESM vs CommonJS to match the existing test suite. Playwright tests are always JS/TS regardless of the application language.

9. Integration with existing infrastructure

Reuses existing page objects, fixtures, utilities, naming conventions, and auth/SSO flows instead of inventing new ones.

10. BLAW-specific function integration

Access to BlawBlocks, BlawAlertsBlocks, DocketsBlocks, and ContractsBlocks when relevant.

11. Accessibility testing integration

Configures Playwright to use the Blocks accessibility reporter and the accessibilityScan fixture for built-in scans.

12. Code quality enforcement

TDD, AAA with section comments, POM, self-documenting code, screenshots on failure, explicit TypeScript types or JSDoc.

13. Browser recording and Codegen support

Recorded Codegen output is transformed to Blocks methods with semantic selectors and AAA structure, then saved to feature-specific directories.

14. Cross-platform compatibility

Generated npm scripts use cross-env, shx, and npm-run-all so they work on Windows, macOS, and Linux.

15. Non-destructive, preservative approach

Never overwrites existing playwright.config, page objects, fixtures, or utilities. New tests integrate with existing infrastructure; recommendations for existing tests go in a separate document.

Example prompts

Repo discovery: Using MCP server blocks, analyze this repository's existing Playwright setup (config, directories, fixtures, page objects, utilities). Check for @qe/blocks installation. Output a concise inventory and what you will reuse vs not touch.
Generate new tests: Using MCP server blocks, generate NEW Playwright E2E tests for the login feature using AAA + POM + Blocks fixtures. Import from @qe/blocks/new-fixtures and transform all Playwright calls to Blocks. Do not overwrite any existing files. Show the exact file paths you will create.
BLAW document search: Using MCP server blocks, generate tests for BLAW document search using BlawBlocks.openDocument().
BLAW alerts: Using MCP server blocks, create tests for BLAW Alerts creation using BlawAlertsBlocks.createAlertswithKeyword().
Dockets: Using MCP server blocks, generate Dockets tests using DocketsBlocks functions for court filtering and docket tracking.
Contracts: Using MCP server blocks, create Contracts tests using ContractsBlocks for document upload and template management.
Transform existing tests: Using MCP server blocks, review this existing Playwright test and recommend how to transform it to use QE Blocks.

Codegen integration with Blocks

I just recorded some browser interactions with Playwright codegen. Here is the generated code:

<paste codegen output>

Can you convert this into a properly structured test file following the best practices in my QE Blocks Tests MCP server? Transform all Playwright patterns to Blocks equivalents and use Blocks fixtures.

The assistant should transform:

BBVPN proxy configuration

When using the V2 URL https://qe-mcp.bindg.com/mcp/v2/blocks behind BBVPN, add qe-mcp.bindg.com to your IDE's http.noProxy setting (not in mcp.json).

{
  "http.noProxy": [
    "qe-mcp.bindg.com"
  ]
}

Validate the connection

Smoke test: Using MCP server qe_blocks_tests_v2, list available tools/capabilities and provide 3 example commands for BLAW Playwright E2E tests with Blocks integration.
Blocks usage check: Using MCP server qe_blocks_tests_v2, check for @qe/blocks installation in this repo and verify Blocks usage patterns.
← Back to MCP Server Guide ← Back to Quality Engineering Tools Suite