BestTester
Production-grade Playwright + TypeScript QA framework with AI-powered testing, LLM-as-Judge evaluation, MCP server, 7 CLI agents, security fuzzing, CI/CD pipelines, Jira sync, and Slack reporting β zero-config, plug-and-play.
Ask AI about BestTester
Powered by Claude Β· Grounded in docs
I know everything about BestTester. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
BestTester
Production-grade, plug-and-play Playwright + TypeScript QE framework for UI, API, mobile, AI-powered, security, i18n, and file-operations testing β with built-in CI/CD, AI agents, LLM-as-Judge evaluation, MCP server, Jenkins orchestration, Jira sync, and Slack reporting.
Why BestTester?
| Advantage | Details |
|---|---|
| Zero-config start | Clone β npm ci β npm run test:smoke β works out of the box with OrangeHRM demo |
| Full Page Object Model | Every page extends BasePage; no inline selectors in spec files |
| AI-native testing | LLM-powered assertions, semantic similarity, AI locator fallback, hallucination detection |
| LLM-as-Judge | Multi-dimensional rubric scoring (relevance, accuracy, coherence, safety, faithfulness) via AWS Bedrock with anti-narcissistic-bias dual-model design |
| MCP integration | Model Context Protocol server (stdio + SSE) lets AI agents navigate, screenshot, run tests, and list specs |
| 7 CLI agents | Code review, test healer, suggestion generator, Jenkins trigger, Jira sync, Slack bot, run-and-report β all from the terminal |
| Security testing | SQLi/XSS fuzzer, security header validator, OWASP ZAP proxy integration |
| Multi-environment | `TEST_ENV=dev |
| Mobile testing | Dedicated mobile test suite with device emulation (Pixel 5, iPhone 13, iPad), touch/swipe helpers, responsive assertions |
| Multi-browser | Chromium, Firefox, WebKit, mobile Chrome, mobile Safari via ALL_BROWSERS=true |
| Mutation testing | Stryker Mutator with configurable thresholds and HTML/JSON reports |
| Full CI/CD | 10 GitHub Actions workflows: CI, nightly, smoke, PR gate, security scan, mutation, AI tests, API tests, report publishing, Copilot review |
| Jenkins pipeline | Jenkinsfile with EC2 provisioning scripts, single-test trigger, remote job management |
| Jira integration | Auto-create/update/close bugs from test results, attach JUnit XML, link test executions to stories |
| Slack notifications | Real-time build results, failure alerts, and report links posted to Slack channels |
| Allure + HTML reports | Dual reporting with Allure (GitHub Pages auto-publish) and Playwright HTML |
| Data factories | Faker-powered factories with auto-teardown registry for clean test isolation |
| File operations | Download verification, Excel read/write, Word document generation, PDF parsing with content assertions |
| i18n testing | Locale switcher, RTL detection, string validation across en, fr, ar, ja |
| Auth matrix | Multi-role testing (Admin, Manager, Employee) with cached storage state |
| Scaffolding CLI | scaffold:page, scaffold:test, scaffold:api generators for consistent code structure |
| Code quality | ESLint + Prettier + Husky pre-commit/pre-push hooks + lint-staged |
| Type safety | Strict TypeScript with Zod schema validation for API responses |
Architecture
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BestTester β
βββββββββββ¬ββββββββββ¬ββββββββββ¬ββββββββββ¬ββββββββββ¬ββββββββββ¬βββββββββββ€
βUI Tests βAPI Testsβ Mobile βAI Tests βSecurity β i18n β File-Ops β
β(PW) β(Axios) β(Emulate)β(Bedrock)β(ZAP) β(Locale) β(xlsx/pdf)β
ββββββββββββ΄βββββββββββ΄βββββββββββ΄βββββββββββ΄βββββββββββ΄ββββββββββββ€
β Page Object Model (src/pages/) β API Layer (src/api/) β
β Mobile Pages (src/mobile/) β Security (src/security/) β
β AI Helpers (src/ai/) β Data Factories (src/data/) β
β Fixtures (src/fixtures/) β i18n (src/i18n/) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β AI: LLM Client β AI Assert β Semantic Assert β LLM Judge β
β AI Locator β Embeddings (Titan) β MCP Server (stdio/SSE) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Agents: Code Review β Test Healer β Suggestions β Jenkins β
β Jira Sync β Slack Bot β Run-and-Report β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β CI/CD: GitHub Actions (10 workflows) β Jenkins (EC2) β
β Reports: Allure β Playwright HTML β Slack β JUnit XML β Jira β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Quick Start
# 1. Clone
git clone https://github.com/your-org/BestTester.git && cd BestTester
# 2. Install
npm ci
# 3. Configure
cp .env.example .env # edit with your credentials β NEVER commit .env
# 4. Install browsers
npm run setup
# 5. Run smoke tests
npm run test:smoke
Directory Structure
BestTester/
βββ .github/workflows/ # 10 CI/CD pipelines (ci, nightly, smoke, pr-gate, security, mutation, ai, api, report, copilot-review)
βββ agents/ # 7 AI CLI agents (review, heal, suggest, jenkins, jira-sync, slack-bot, run-and-report)
βββ config/ # Playwright config, global-setup, per-environment .env files (dev/staging/prod)
βββ mcp/ # MCP server (stdio + SSE) and AI test generator client
βββ mutation/ # Stryker mutation testing config and HTML/JSON reports
βββ scripts/ # Shell & TS utilities (Jenkins provisioning, Slack, scaffolding, EC2)
βββ src/
β βββ ai/ # LLM client (Bedrock), AI assertions, semantic assertions, AI locator
β β βββ judge/ # LLM-as-Judge: multi-rubric evaluation, safety checks, pairwise comparison
β βββ api/ # API client layer (BaseAPI + auth, employee, leave clients)
β βββ auth/ # Multi-role auth (Admin/Manager/Employee), storage state caching
β βββ components/ # Reusable UI components (form, modal, navbar, table)
β βββ constants/ # Shared constants
β βββ data/ # Test data factories (Faker) + teardown registry
β βββ fixtures/ # Custom Playwright fixtures (base, api, auth, mobile)
β βββ i18n/ # Locale switcher, RTL detection, string validator
β βββ mobile/ # Mobile page objects (BaseMobilePage + login, products, cart)
β βββ pages/ # Page Object Model (login, dashboard, employee, leave, reports)
β βββ security/ # SQLi/XSS fuzzer, security header validator, OWASP ZAP client
β βββ types/ # TypeScript interfaces (API responses, config, employee, Jira)
β βββ utils/ # Logger (Winston), Slack, Jenkins, 1Password, Jira, file-handler, download-verifier, Excel, webhook
βββ tests/
β βββ ai/ # AI/LLM response validation and content tests
β βββ api/smoke/ # API smoke tests
β βββ api/regression/ # API regression tests with Zod schema validation
β βββ auth-matrix/ # Multi-role access control tests
β βββ file-ops/ # File download, Excel, Word, PDF tests
β βββ i18n/ # Internationalization smoke tests
β βββ mobile/ # Mobile device emulation tests (login, products, responsive)
β βββ security/ # Security header and penetration tests
β βββ ui/smoke/ # UI smoke suite (@smoke)
β βββ ui/regression/ # UI regression suite (@regression)
β βββ ui/e2e/ # End-to-end journeys (@e2e)
β βββ ui/visual/ # Visual regression tests (@visual)
βββ Jenkinsfile # Main Jenkins pipeline
βββ Jenkinsfile.single-test # Single-test Jenkins pipeline
βββ README.md
Running Tests
# All tests
npm test
# By type
npm run test:ui # UI tests
npm run test:api # API tests
npm run test:ai # AI/LLM tests
npm run test:mobile # Mobile device emulation tests
npm run test:file-ops # File operation tests
npm run test:security # Security tests
npm run test:i18n # Internationalization tests
npm run test:auth-matrix # Multi-role auth tests
# By tag
npm run test:smoke # @smoke
npm run test:regression # @regression
npm run test:e2e # @e2e
npm run test:visual # @visual
# Debug modes
npm run test:headed # Headed browser
npm run test:debug # Playwright inspector
# Mutation testing
npm run test:mutation # Stryker mutation analysis
Per Environment
TEST_ENV=dev npm test
TEST_ENV=staging npm test
TEST_ENV=prod npm test
Cross-Browser
ALL_BROWSERS=true npm test # Chromium + Firefox + WebKit + mobile Chrome + mobile Safari
Mobile Testing
npm run test:mobile # Pixel 5 + iPhone 13
npm run test:mobile -- --project mobile-chrome # Android only
npm run test:mobile -- --project mobile-safari # iOS only
MOBILE_TABLET=true npm run test:mobile # Include iPad
npm run test:mobile -- --headed # Watch execution
AI-Powered Testing
LLM Client (AWS Bedrock)
Built on AWS Bedrock Converse API with Amazon Nova Pro as the default model. Supports chat, summarization, and embeddings (Titan Embed v2).
AI Assertions
- Semantic similarity β cosine similarity on Titan embeddings with configurable threshold
- Hallucination detection β keyword-based grounding checks
- AI locator fallback β sends DOM snapshot to LLM to resolve broken selectors
LLM-as-Judge
Multi-dimensional evaluation system with 6 built-in rubrics:
| Rubric | Use Case | Pass Threshold |
|---|---|---|
| Standard | General response quality | 3.5 |
| RAG Faithfulness | Grounding in source documents | 4.0 |
| Customer Support | Empathy, accuracy, actionability | 3.5 |
| Code Generation | Correctness, security, structure | 4.0 |
| Summarization | Coverage, conciseness, faithfulness | 3.5 |
| Toxicity & Safety | Hate speech, PII, prompt injection | 4.5 |
Scores across 6 dimensions: relevance, accuracy, coherence, safety, faithfulness, instruction adherence.
Anti-narcissistic bias: Primary model (Nova Pro) and judge model (Claude Haiku) use different architectures to prevent self-evaluation bias. Borderline scores (2β3) trigger automatic strict re-evaluation.
Semantic Assertions API
import { semanticExpect } from '@ai/semantic-assert';
await semanticExpect(response).toBeRelevantTo(prompt);
await semanticExpect(response).toBeGroundedIn(sourceContext);
await semanticExpect(response).toBeSafe();
await semanticExpect(response).toNotHallucinate(knownFacts);
await semanticExpect(response).toBeBetterThan(alternativeResponse);
await semanticExpect(response).toHaveScore({ min: 4.0, rubric: RUBRICS.CODE_GENERATION });
MCP Server
Model Context Protocol server for AI-driven test orchestration. Supports both stdio and SSE transports.
npm run mcp:server # stdio mode
npm run mcp:server:sse # SSE mode on port 3001
npm run mcp:generate # AI test generator client
Available MCP tools:
| Tool | Description |
|---|---|
navigate | Open URL, return title + screenshot |
screenshot | Full-page screenshot of any URL |
get_page_text | Extract visible text from a page |
run_test | Execute a specific test file |
list_tests | List all available test specs |
AI Agents
Code Review Agent
npm run agent:review -- --file tests/ui/login.spec.ts
npm run agent:review -- --file tests/ui/login.spec.ts --slack # post to Slack
Test Healer Agent
Auto-detects broken locators in failed tests and suggests AI-powered fixes on a new git branch.
npm run agent:heal -- --test-result reports/playwright-report/results.json
Suggestion Agent
Analyzes page objects + existing test coverage and generates 5β10 new test case suggestions.
npm run agent:suggest -- --page src/pages/employee.page.ts
Jenkins Trigger Agent
npm run agent:jenkins -- --job playwright-tests --params ENV=staging
npm run agent:jenkins -- --job playwright-tests --build 42
npm run agent:jenkins -- --job playwright-tests --build 42 --logs
Jira Sync Agent
Auto-creates/updates/closes Jira bugs from test results. Attaches JUnit XML and links test executions.
npm run agent:jira -- --build latest
npm run agent:jira -- --junit reports/playwright-report/junit.xml --build 42
npm run agent:jira -- --junit reports/playwright-report/junit.xml --dry-run
Run-and-Report Agent
Full workflow: trigger Jenkins β stream console β download artifacts β sync to Jira β notify Slack.
npm run agent:run-and-report
npm run agent:run-and-report -- --suite smoke --jira-key SCRUM-5
npm run agent:run-and-report -- --suite regression --jira-key SCRUM-5 --dry-run
Slack Bot Agent
npx ts-node agents/slack-bot-agent.ts --report reports/playwright-report/results.json
Mobile Testing
Dedicated mobile test suite using Playwright device emulation against SauceDemo β a free, publicly available e-commerce demo app.
Device profiles:
| Project | Device | Viewport | Touch |
|---|---|---|---|
mobile-chrome | Pixel 5 | 393Γ851 | β |
mobile-safari | iPhone 13 | 390Γ844 | β |
tablet | iPad (gen 7) | 810Γ1080 | β |
Mobile page objects extend BaseMobilePage which provides:
swipe(direction, distance)β simulate touch swipe gesturestap(selector)β touch tap interactionisResponsive()β assert viewport is mobile-sized (<768px)getViewportSize()β retrieve current device dimensions
Test coverage:
- Login flows (valid, invalid, locked user)
- Product browsing and cart management
- Responsive layout assertions
- Burger menu navigation
- Touch scroll interactions
Adding a Mobile Page Object
import { Page } from '@playwright/test';
import { BaseMobilePage } from './base-mobile.page';
export class MobileCheckoutPage extends BaseMobilePage {
private readonly firstNameInput = this.page.locator('[data-test="firstName"]');
constructor(page: Page) { super(page); }
async fillName(name: string): Promise<void> { await this.firstNameInput.fill(name); }
}
Then register in src/fixtures/mobile.fixture.ts.
Security Testing
- SQLi/XSS fuzzer β automated form fuzzing with common injection payloads, validates no 500 errors or reflected XSS
- Security header validator β asserts CSP, HSTS (β₯1 year), X-Frame-Options, X-Content-Type-Options, Referrer-Policy
- OWASP ZAP integration β proxy mode for passive/active scanning with spider and alert retrieval
CI/CD Pipelines
| Workflow | Trigger | What it does |
|---|---|---|
ci.yml | Push / PR | Lint β smoke tests β Playwright report β Slack |
nightly.yml | Cron 2 AM UTC | Full regression β Allure report β Slack β auto-create GitHub issue on failure |
smoke.yml | Manual / reusable | Smoke suite only |
pr-gate.yml | Pull request | Quality gate checks |
api-tests.yml | Manual / schedule | API smoke + regression |
ai-tests.yml | Manual / schedule | AI/LLM validation tests |
security-scan.yml | Manual / schedule | Security test suite |
mutation.yml | Manual | Stryker mutation testing |
report.yml | Post-nightly | Publish Allure to GitHub Pages |
copilot-review.yml | PR | AI-assisted code review |
Jenkins
Jenkinsfileβ full pipeline with parameterized suite selectionJenkinsfile.single-testβ run a single test file remotely- EC2 provisioning scripts for Jenkins server setup
- Remote job creation and configuration utilities
Reporting
npm run report:allure # Generate + open Allure report
npm run report:playwright # Open Playwright HTML report
Reports are generated in 4 formats: HTML, JSON, JUnit XML, and Allure. Allure is auto-published to GitHub Pages on nightly runs.
Scaffolding
npm run scaffold:page -- --name MyFeature # β src/pages/my-feature.page.ts + test stub
npm run scaffold:test -- --name my-feature # β tests/ui/regression/my-feature.spec.ts
npm run scaffold:api -- --name my-resource # β src/api/my-resource.api.ts
Adding a New Page Object
import { Page } from '@playwright/test';
import { BasePage } from './base.page';
export class MyFeaturePage extends BasePage {
private readonly submitButton = this.page.getByRole('button', { name: 'Submit' });
constructor(page: Page) { super(page); }
async goto(): Promise<void> { await this.navigate('/my-feature'); }
async submit(): Promise<void> { await this.submitButton.click(); }
}
Then register in src/fixtures/base.fixture.ts.
Tech Stack
| Category | Technologies |
|---|---|
| Test framework | Playwright, TypeScript |
| Mobile testing | Playwright device emulation (Pixel 5, iPhone 13, iPad) |
| AI/LLM | AWS Bedrock (Nova Pro, Claude Haiku, Titan Embeddings), OpenAI |
| MCP | @modelcontextprotocol/sdk (stdio + SSE) |
| API testing | Axios, Zod schema validation |
| Security | OWASP ZAP, custom SQLi/XSS fuzzer |
| Data | Faker.js, ExcelJS, pdf-parse, PDFKit, docx |
| CI/CD | GitHub Actions, Jenkins |
| Reporting | Allure, Playwright HTML, JUnit XML |
| Integrations | Jira (REST API), Slack (Webhooks + Web API), GitHub API, 1Password CLI |
| Code quality | ESLint, Prettier, Husky, lint-staged |
| Mutation testing | Stryker Mutator |
| Logging | Winston |
| Version control | simple-git |
| Secret management | 1Password CLI (op) |
1Password Integration
Securely manage secrets via the 1Password CLI instead of storing them in .env.
- Install the 1Password CLI (
op): https://developer.1password.com/docs/cli/get-started - Create a Service Account and paste the token into
OP_SERVICE_ACCOUNT_TOKENin.env - Use the
OnePasswordutility in global-setup, fixtures, or scripts:
import { OnePassword } from '@utils/one-password';
const op = new OnePassword('BestTester'); // vault name
// Inject all fields from a vault item into process.env
op.injectEnv('BestTester Secrets');
// Or map specific fields to env vars
op.injectEnv('BestTester Secrets', {
SLACK_BOT_TOKEN: 'Slack Bot Token',
JIRA_API_TOKEN: 'Jira API Token',
AWS_SECRET_ACCESS_KEY: 'AWS Secret Key',
});
// Create a new secret
op.createItem('API Credentials', { apiKey: 'sk-abc123' });
// Update an existing field
op.setField('BestTester Secrets', 'GitHub Token', 'ghp_new...');
| Method | Description |
|---|---|
getField(item, field) | Read a single secret value |
getItem(item) | Read all fields from an item |
listItems() | List all vault items |
createItem(title, fields) | Create a new item |
setField(item, field, value) | Update a field on an existing item |
deleteItem(item) | Delete an item |
injectEnv(item, mapping?) | Bulk-inject fields into process.env |
whoAmI() | Verify CLI authentication |
Contributing
See CONTRIBUTING.md for full guidelines.
- Fork and create a feature branch:
git checkout -b feat/my-feature - Follow ESLint + Prettier rules (enforced by Husky pre-commit hooks)
- All tests must use Page Object Model β no inline selectors in spec files
- No
page.waitForTimeout()β use Playwright auto-waiting - Every test file must have a JSDoc block with
@file,@description,@tags - Run
npm run lint && npm run typecheck && npm run test:smokebefore opening a PR - Open a PR against
develop
Keywords
playwright, typescript, test-automation, e2e-testing, api-testing, ai-testing, llm-testing, aws-bedrock, page-object-model, playwright-typescript, playwright-framework, playwright-boilerplate, playwright-template, test-framework, qa-automation, qe-framework, selenium-alternative, ui-testing, visual-regression, security-testing, owasp-zap, mutation-testing, stryker, allure-report, ci-cd, github-actions, jenkins, jira-integration, slack-bot, mcp, model-context-protocol, llm-as-judge, ai-assertions, semantic-testing, hallucination-detection, cross-browser-testing, i18n-testing, mobile-testing, device-emulation, responsive-testing, touch-testing, data-factory, test-data-management, download-verification, excel-testing, pdf-testing, playwright-best-practices, playwright-page-object, playwright-fixtures, playwright-ci-cd, playwright-ai, bedrock-testing, nova-pro, claude-haiku, titan-embeddings
License
Apache License 2.0 β see LICENSE for details.
You are free to use, modify, and distribute this framework in personal and commercial projects. Contributions are welcome and will be licensed under the same terms.
