Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计通过

create-pom创建 pom

Agent Skill

create-pom 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

441

周安装

18

GitHub Stars

8

下载量

141
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:create-pom(创建 pom)
来源仓库:https://github.com/agentmantis/test-skills
仓库路径:skills/create-pom
安装命令:
npx skills add https://github.com/agentmantis/test-skills --skill create-pom
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/agentmantis/test-skills --skill create-pom

简介

生成 Page Object Model 类文件,遵循 E2E 测试最佳实践封装页面元素操作。

  • 自动继承 base.page.ts 基类,避免重复造轮子并保持测试代码一致性。
  • 检查现有 POM 文件,仅在不存在时创建新类,防止同一页面出现多个定义。
  • 使用前应确认 e2e/poms/ 目录结构符合项目约定,避免路径错误导致文件错位。
  • create-pom 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Create Page Object Model

Generate a POM class for the specified page following all E2E test conventions.


Workflow

  1. Determine the page name from the user's request (e.g., "Settings" → settings.page.ts)
  2. Check if a POM already exists for this page in e2e/poms/. If so, add methods to the existing POM — do NOT create a second POM for the same page
  3. Identify the base page class in e2e/poms/base.page.ts and extend it
  4. Read the target page in the application to understand its elements and interactions
  5. Generate the POM file following the template below
  6. Verify the file compiles with no TypeScript errors

Rules

  • One page = one POM — every distinct page/view gets exactly one POM file
  • All POMs extend the base page class — check e2e/poms/base.page.ts for the abstract class
  • Implement setUp() and tearDown() — inherited from the base class
  • Reusable helpers belong in BasePage — if a helper method is useful across multiple POMs (e.g., waitForToast, dismissModal), it must live in BasePage, not in a derived POM. Derived POMs should contain only page-specific behavior. If you find yourself writing the same helper in a second POM, promote it to BasePage immediately
  • NEVER reference another POM from within a POM — if a test needs multiple pages, the spec file orchestrates between POMs
  • Detailed JSDoc on every public method — describe what it does step by step, with @param tags
  • Use the selector priority order: getByRole() > getByLabel() > getByText() > getByPlaceholder() > locator()

POM Structure

Organise every POM with these clearly separated sections using comment banners:

import { Page, Locator, expect } from '@playwright/test';
// TODO: Import your project's base page class
import { BasePage } from './base.page';

export class FeaturePage extends BasePage {
    constructor(page: Page) {
        super(page);
    }

    // ==========================================
    // LIFECYCLE (from BasePage)
    // ==========================================

    /**
     * Navigates to the feature page and cleans up any stale data
     * left by previous failed test runs.
     *
     * Steps:
     * 1. Navigates to /feature via direct URL.
     * 2. Waits for the page heading to be visible.
     * 3. Deletes any items matching the test data pattern.
     */
    async setUp(): Promise<void> {
        // TODO: Implement navigation and cleanup
    }

    /**
     * Cleans up any data created during the test suite.
     *
     * Steps:
     * 1. Navigates to /feature.
     * 2. Deletes all items created by this test run.
     */
    async tearDown(): Promise<void> {
        // TODO: Implement cleanup
    }

    // ==========================================
    // LOCATORS
    // ==========================================

    /** The main heading of the feature page. */
    get heading(): Locator {
        return this.page.getByRole('heading', { name: 'Feature Name' });
    }

    /** The "Create" button that opens the creation modal. */
    get createButton(): Locator {
        return this.page.getByRole('button', { name: /create/i });
    }

    // TODO: Add locators for all interactive elements on this page

    // ==========================================
    // NAVIGATION
    // ==========================================

    /**
     * Navigates directly to the feature page via URL.
     *
     * Steps:
     * 1. Calls page.goto('/feature').
     * 2. Asserts the page heading is visible.
     * 3. Asserts the URL contains '/feature'.
     */
    async navigateToPage(): Promise<void> {
        await this.page.goto('/feature');
        await expect(this.heading).toBeVisible();
        await expect(this.page).toHaveURL(/\/feature/);
    }

    // ==========================================
    // VERIFICATION
    // ==========================================

    /**
     * Verifies an item appears in the list with the expected name.
     *
     * Steps:
     * 1. Locates the item row by name text.
     * 2. Asserts the row is visible.
     *
     * @param name - The expected item name
     */
    async verifyItemExists(name: string): Promise<void> {
        await expect(
            this.page.getByRole('row', { name: new RegExp(name, 'i') })
        ).toBeVisible();
    }

    // ==========================================
    // CREATE
    // ==========================================

    /**
     * Creates a new item via the creation modal.
     *
     * Steps:
     * 1. Clicks the "Create" button to open the modal.
     * 2. Fills in the name field.
     * 3. Clicks "Submit" and waits for the modal to close.
     *
     * @param name - Display name for the new item
     */
    async createItem(name: string): Promise<void> {
        await this.createButton.click();
        const modal = this.page.getByRole('dialog');
        await modal.getByLabel('Name').fill(name);
        await modal.getByRole('button', { name: 'Submit' }).click();
        await expect(modal).toBeHidden();
    }

    // ==========================================
    // EDIT
    // ==========================================

    // TODO: Add edit methods

    // ==========================================
    // DELETE
    // ==========================================

    // TODO: Add delete methods
}

JSDoc Requirements

Every public method MUST have a JSDoc comment with:

  1. Summary line — what the method does
  2. Steps block — numbered list of what happens when called
  3. @param tags — for every parameter
  4. @returns tag — if the method returns a value

This is critical because LLMs read these comments to understand what actions are available and generate test specs from them.

/**
 * Updates an existing item's name and value.
 *
 * Steps:
 * 1. Locates the item row by its current name.
 * 2. Clicks the "Edit" button within that row.
 * 3. Clears and fills the name field with the new name.
 * 4. Clears and fills the value field with the new value.
 * 5. Clicks "Save" and waits for the edit modal to close.
 * 6. Waits for the success toast notification to appear.
 *
 * @param currentName - The item's current display name (used to locate the row)
 * @param newName     - The new display name
 * @param newValue    - The new value
 */
async editItem(currentName: string, newName: string, newValue: string): Promise<void> {

Naming

  • File: e2e/poms/{feature}.page.ts (lowercase, kebab-case feature name)
  • Class: {Feature}Page (PascalCase)
  • The feature name must match the corresponding spec and test-data files

See references/pom-template.md for the full boilerplate.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.01%
按下载量换算49

Claude

29.22%
按下载量换算41

Cursor

19.9%
按下载量换算28

Gemini CLI

9.94%
按下载量换算14

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills