Logo Content Testing

Content Testing

Cộng đồng
alpham8
content-testing

Dùng khi viết hoặc đánh giá kiểm thử cho trang web, phản hồi API, đầu ra CLI hoặc bất kỳ nội dung nào hiển thị cho người dùng. Đảm bảo kiểm thử xác minh nội dung và cấu trúc thực tế, chứ không chỉ kiểm tra mã trạng thái hoặc kiểu phản hồi. Kích hoạt khi gặp tệp kiểm thử, phương thức kiểm thử, assertResponseIsSuccessful, assertResponseStatusCodeSame, kiểm tra mã trạng thái, kiểm thử phản hồi HTTP, kiểm thử controller, kiểm thử endpoint, kiểm thử tích hợp, kiểm thử chức năng.

Add to TypingMind

Tổng quan

Nhà phát hànhalpham8
Kho mãagentic-webdev
Tên kỹ năngcontent-testing
Sao
4
Bản fork
0
Tệp đi kèm
Chỉ có hướng dẫn
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được alpham8 công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Content Testing trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/alpham8/agentic-webdev/tree/master/skills/content-testing
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/alpham8/agentic-webdev.git /tmp/agentic-webdev
mkdir -p .claude/skills
cp -r /tmp/agentic-webdev/skills/content-testing .claude/skills/content-testing
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Content Testing trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Content Testing ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Content Testing với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Content Testing — Deep Assertions

Core Principle

A test that only checks a status code proves the server didn't crash. It does not prove the page is correct.

Every test for user-facing output must assert what the user actually sees or receives — not just that "something was returned successfully."

When This Skill Applies

  • Writing or reviewing tests for web pages (HTML responses)
  • Writing or reviewing tests for API endpoints (JSON/XML responses)
  • Writing or reviewing tests for CLI commands (stdout/stderr output)
  • Writing or reviewing tests for email templates, PDF generation, RSS feeds
  • Any test that checks a response status code without also checking the response body

The Rule

STATUS CODE + CONTENT ASSERTIONS = VALID TEST
STATUS CODE ONLY = INCOMPLETE TEST

A status-code-only test is a smoke test — useful as a baseline, but never sufficient on its own.

Assertion Depth Pyramid

Every test should climb as high on this pyramid as the feature requires:

Level 4: Semantic correctness
         (values are correct, relationships hold, business logic works)

Level 3: Content verification
         (text matches, data is present, translations render)

Level 2: Structural verification
         (elements exist, correct nesting, required sections present)

Level 1: Response verification
         (status code, content-type, headers)

Level 1 — Response Verification (Minimum)

Status code, content type, critical headers.

✅ Response is 200
✅ Content-Type is text/html (or application/json, application/xml)
✅ Cache headers are set correctly

This level alone is never sufficient for a content test.

Level 2 — Structural Verification

The response contains the expected structural elements.

HTML pages:

  • Required sections/containers exist (navigation, main content, footer)
  • Form fields are present and have correct types
  • Interactive elements exist (buttons, links, widgets)
  • SEO elements exist (meta tags, JSON-LD blocks, hreflang tags)

JSON APIs:

  • Required keys exist
  • Array fields have expected structure
  • Nested objects have correct shape

XML/RSS feeds:

  • Required elements exist (channel, item, entry)
  • Each item has required child elements

CLI output:

  • Expected sections/headers appear
  • Table structure is correct

Level 3 — Content Verification

The content is actually correct, not just structurally present.

HTML pages:

  • Headings contain expected text
  • Navigation links point to correct URLs
  • Form labels match the current locale
  • Translated strings render (not raw translation keys)
  • Company/legal info is present (name, address, tax ID)

JSON APIs:

  • Values match expected data
  • Counts are correct
  • Enum values are valid

XML/RSS feeds:

  • Item titles are non-empty
  • Links are valid URLs
  • Dates are parseable

Level 4 — Semantic Correctness

The feature works correctly as a whole.

  • Pagination shows different content per page
  • Search returns relevant results
  • Locale-specific content uses the correct language
  • Filtered lists exclude non-matching items
  • Related/recommended items are actually related
  • SEO structured data contains correct values (not just correct structure)

Checklist by Feature Type

Web Page Tests

[ ] Status code (200, 301, 404, etc.)
[ ] Page title contains expected text
[ ] H1 heading exists and contains expected text
[ ] Main content section exists
[ ] Navigation exists with correct links
[ ] Footer exists with required content
[ ] Meta tags present (description, og:*, article:*)
[ ] Structured data present (JSON-LD)
[ ] Hreflang tags correct (multilingual sites)
[ ] html lang attribute matches locale
[ ] Forms have all required fields
[ ] Interactive widgets present (CAPTCHA, date pickers, etc.)
[ ] Images have alt attributes

Multilingual Page Tests

[ ] Each locale returns correct html lang
[ ] Page title is in the correct language
[ ] H1 is in the correct language
[ ] Navigation labels match locale
[ ] Hreflang tags link to all locales
[ ] x-default hreflang points to default locale
[ ] Language switcher exists and links to other locale
[ ] Translated content renders (not raw keys like 'nav.home')
[ ] Date/number formatting follows locale conventions

Form Tests

[ ] All input fields exist (name, type, id)
[ ] Labels are present and associated
[ ] Required fields are marked
[ ] Submit button exists
[ ] CAPTCHA/anti-spam widget present
[ ] Validation errors display for invalid input
[ ] Error messages are user-friendly and localized
[ ] Success page/response has correct content

API Endpoint Tests

[ ] Status code correct
[ ] Content-Type header correct
[ ] Response body has expected structure (keys, nesting)
[ ] Array responses have expected item count or range
[ ] Each item has required fields
[ ] Values are of correct type
[ ] Empty results return empty array, not null/error
[ ] Error responses have structured error body

RSS/XML Feed Tests

[ ] Content-Type is application/xml or application/rss+xml
[ ] Root element is correct (rss, feed, urlset)
[ ] Channel/feed metadata present (title, link, description)
[ ] Items have required elements (title, link, pubDate/updated)
[ ] Item content is non-empty
[ ] URLs are absolute
[ ] Dates are valid

SEO Tests

[ ] Title tag present and non-empty
[ ] Meta description present and non-empty
[ ] Open Graph tags present (og:title, og:description, og:type)
[ ] JSON-LD structured data present and valid type
[ ] Canonical URL correct
[ ] Hreflang tags for all supported locales
[ ] Sitemap contains all public URLs
[ ] noindex on pages that should not be indexed (success pages, admin)
[ ] Breadcrumb JSON-LD on subpages

Pagination Tests

[ ] Page 1 returns correct number of items
[ ] Page 2 has different items than page 1
[ ] Out-of-range page numbers are handled (clamped or 404)
[ ] Pagination controls exist (links, buttons)
[ ] Current page is indicated

Anti-Patterns

Status-Code-Only Test

❌ BAD — proves nothing about page content
test('homepage returns 200')
    GET /
    assert status == 200

✅ GOOD — proves the page renders correctly
test('homepage contains hero section and services')
    GET /
    assert status == 200
    assert selector 'section.hero' exists
    assert selector 'section.hero h1' exists
    assert selector '#services' exists
    assert selector '.service-card' count >= 3

Mock-Heavy Content Test

❌ BAD — tests the mock, not the page
test('blog shows posts')
    mock BlogService to return [fake post]
    GET /blog
    assert status == 200

✅ GOOD — tests with real data
test('blog listing shows actual posts with structure')
    GET /blog
    assert status == 200
    assert '.blog-card' count > 0
    for each .blog-card:
        assert has date element
        assert has title link
        assert has excerpt

Single-Locale Testing

❌ BAD — only tests one language
test('contact page works')
    GET /kontakt
    assert status == 200

✅ GOOD — tests both locales with content
test('contact page DE has German heading')
    GET /kontakt
    assert h1 contains 'Kontakt'

test('contact page EN has English heading')
    GET /en/contact
    assert h1 contains 'Contact'

How to Apply This Skill

When writing or reviewing tests:

  1. Identify the test's purpose — what user-facing feature does it verify?
  2. Check the assertion depth — is it Level 1 only? Climb higher.
  3. Walk the checklist — use the relevant checklist above for the feature type.
  4. Test both/all locales — if the app is multilingual, every content test needs locale variants.
  5. Verify real content — use assertions against actual rendered text, DOM structure, or response data. Don't just check that "something" exists.

Relationship to Other Skills

SkillRelationship
TDDTDD defines when to write tests (before code). This skill defines what depth to test.
Symfony / PHPFramework-specific assertion helpers (assertSelectorExists, assertSelectorTextContains).
Frontend DesignWhat to verify in UI tests (sections, components, accessibility).

Câu hỏi thường gặp

Kỹ năng AI Content Testing làm được gì?

Dùng khi viết hoặc đánh giá kiểm thử cho trang web, phản hồi API, đầu ra CLI hoặc bất kỳ nội dung nào hiển thị cho người dùng. Đảm bảo kiểm thử xác minh nội dung và cấu trúc thực tế, chứ không chỉ kiểm tra mã trạng thái hoặc kiểu phản hồi. Kích hoạt khi gặp tệp kiểm thử, phương thức kiểm thử, assertResponseIsSuccessful, assertResponseStatusCodeSame, kiểm tra mã trạng thái, kiểm thử phản hồi HTTP, kiểm thử controller, kiểm thử endpoint, kiểm thử tích hợp, kiểm thử chức năng.

Vì sao nên dùng Content Testing trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Content Testing là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Content Testing trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/alpham8/agentic-webdev/tree/master/skills/content-testing. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Content Testing?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Content Testing với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Content Testing với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Content Testing có miễn phí không?

Kỹ năng này được alpham8 phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇