Chuyển đến nội dung
Skillpedia
Kiểm thử48k · #5815

smartui-skill

Skill này làm gì

Công cụ này giúp thiết lập các bài kiểm thử tự động so sánh ảnh chụp màn hình website. Nó đảm bảo diện mạo website không thay đổi một cách ngoài ý muốn.

Khi nào nên dùng

  • ✓Khi bạn muốn so sánh diện mạo website trước và sau một thay đổi.
  • ✓Khi bạn thiết lập kiểm thử để kiểm tra ảnh chụp màn hình có đúng không.
  • ✓Khi bạn dùng các công cụ như Playwright, Selenium, Cypress hoặc Puppeteer để kiểm thử website.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/smartui-skill/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/smartui-skill/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Thiết lập kiểm thử hồi quy trực quan cho website của tôi bằng SmartUI.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ tạo cấu hình để so sánh ảnh chụp màn hình. Nó hoạt động với nhiều công cụ kiểm thử khác nhau và có thể dùng qua dòng lệnh hoặc tích hợp vào code.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

SmartUI Visual Regression Skill

When to Use

Use this skill when you need generates SmartUI visual regression test configurations for screenshot comparison on TestMu AI cloud. Framework-agnostic — works with Playwright, Selenium, Cypress, Puppeteer. Use when user mentions "SmartUI", "visual regression", "screenshot comparison", "visual testing". Triggers on:...

Core Patterns

Playwright + SmartUI SDK

const { chromium } = require('playwright');
const { smartuiSnapshot } = require('@lambdatest/smartui-cli');

(async () => {
  const browser = await chromium.launch();
  const page = await browser.newPage();

  await page.goto('https://example.com');
  await smartuiSnapshot(page, 'Homepage');

  await page.goto('https://example.com/login');
  await smartuiSnapshot(page, 'Login Page');

  await browser.close();
})();

Selenium + SmartUI

// Take SmartUI screenshot
((JavascriptExecutor) driver).executeScript(
    "smartui.takeScreenshot=Login Page"
);

CLI Execution

# Install
npm install @lambdatest/smartui-cli --save-dev

# Configure
npx smartui config:create smartui.config.json

# Execute
npx smartui exec -- node test.js
# or with Playwright
npx smartui exec -- npx playwright test

smartui.config.json

{
  "web": {
    "browsers": ["chrome", "firefox", "safari"],
    "viewports": [[1920, 1080], [1366, 768], [375, 812]]
  },
  "waitForPageRender": 5000,
  "waitForTimeout": 1000
}

SmartUI with Storybook

npx smartui storybook http://localhost:6006 --config smartui.config.json

Approval Workflow

  1. First run creates baseline screenshots
  2. Subsequent runs compare against baseline
  3. Differences highlighted in dashboard
  4. Approve/reject changes in LambdaTest SmartUI dashboard
  5. Approved screenshots become new baseline

Anti-Patterns

Bad Good Why
No viewport config Multiple viewports Responsive issues
No wait for render waitForPageRender Incomplete screenshots
Screenshot everything Key pages/components Noise reduction
No approval process Review diffs in dashboard Catch regressions

Cloud Authentication

Set environment variables:

export PROJECT_TOKEN="your-smartui-project-token"   # From SmartUI dashboard
export LT_USERNAME="your-username"                   # For Selenium/Playwright cloud
export LT_ACCESS_KEY="your-access-key"               # For Selenium/Playwright cloud

CLI approach (uses PROJECT_TOKEN):

npx smartui exec -- npx playwright test

Selenium Cloud approach (uses LT_USERNAME/LT_ACCESS_KEY):

// Capabilities include SmartUI options
HashMap<String, Object> ltOptions = new HashMap<>();
ltOptions.put("user", System.getenv("LT_USERNAME"));
ltOptions.put("accessKey", System.getenv("LT_ACCESS_KEY"));
ltOptions.put("build", "SmartUI Build");
ltOptions.put("smartUI.project", "My SmartUI Project");
ChromeOptions options = new ChromeOptions();
options.setCapability("LT:Options", ltOptions);
WebDriver driver = new RemoteWebDriver(
    new URL("https://hub.lambdatest.com/wd/hub"), options);

Quick Reference

Task Command
Install npm install @lambdatest/smartui-cli
Init config npx smartui config:create smartui.config.json
Run npx smartui exec -- <test command>
Storybook npx smartui storybook <url>
Dashboard https://smartui.lambdatest.com

Deep Patterns

For advanced patterns, debugging guides, CI/CD integration, and best practices, see reference/playbook.md.

Limitations

  • Use this skill only when the task clearly matches its upstream source and local project context.
  • Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.
  • Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.
Câu hỏi thường gặp

Kiểm thử hồi quy trực quan (visual regression) là gì?

Đó là khi một thay đổi code gây ra sự thay đổi ngoài ý muốn về diện mạo website.

Tôi có cần biết lập trình để dùng không?

Có chút kiến thức lập trình sẽ hữu ích, vì công cụ tạo cấu hình và code cho các bài kiểm thử.

Xem kết quả ở đâu?

Kết quả, bao gồm các khác biệt về hình ảnh, được hiển thị trên bảng điều khiển trực tuyến có tên LambdaTest SmartUI dashboard.

Chi tiết

Mô tả gốc của tác giả

Generates SmartUI visual regression test configurations for screenshot comparison on TestMu AI cloud. Framework-agnostic — works with Playwright, Selenium, Cypress, Puppeteer. Use when user mentions \"SmartUI\", \"visual regression\", \"screenshot comparison\", \"visual testing\".

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#5815
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự