Agent skill

Page Load Assertion

by DanielSuo117 in DanielSuo117/velocitai

ispageloaded() 四种验证模式与调用层级。触发:页面断言、ispageloaded、page loaded、页面加载验证。

MITAuto-check passedTesting & QA

Install Page Load Assertion

skills CLI
$ npx skills add DanielSuo117/velocitai --skill page-load-assertion -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install DanielSuo117/velocitai page-load-assertion --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/DanielSuo117/velocitai.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/page-load-assertion .claude/skills/page-load-assertion && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
page-load-assertion
GitHub stars
158
Token cost
~776 tokens
SKILL.md length
130 words
Files
2 (incl. references)
Skills in repo
13
Repo updated
First seen
Licence
MIT

At a glance

ispageloaded() 四种验证模式与调用层级。触发:页面断言、ispageloaded、page loaded、页面加载验证。

  • Works in 3 steps: class setup:登录后 assert… → function reset:if not… → 用例体:每次跳转后 assert…
  • Testing & QA work in your project
  • SKILL.md covers 核心思路, is_page_loaded() 的四种验证模式, 模式选择决策树 and 验证元素的选择原则, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Page Load Assertion is an agent skill from DanielSuo117/velocitai. ispageloaded() 四种验证模式与调用层级。触发:页面断言、ispageloaded、page loaded、页面加载验证。

Its SKILL.md is about 780 tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/blank-screen-detection.md`).

It sits in Testing & QA. The repository describes itself as: Next-generation UI automation harness powered by Python & Playwright. Chat with AI Agents to seamlessly generate, architect, and execute enterprise-grade UI test code. The licence is MIT.

When your agent uses it

  • Testing & QA work in your project

Example prompts

  • “/page-load-assertion”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. class setup:登录后 assert home.is_page_loaded(), "首页加载失败"
  2. function reset:if not self.home.is_page_loaded(): click_nav_home(); assert ...
  3. 用例体:每次跳转后 assert target.is_page_loaded(), "<页面>加载失败"

What it can do on your machine

Read from SKILL.md and the folder at commit dfcca7e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Page Load Assertion loads about 776 tokens when it runs, and up to ~1.6k if it reads all its reference files. Until then it costs about 23 tokens; SKILL.md has 130 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~23
When it runs · the whole SKILL.md, loaded when a task matches
~776
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from DanielSuo117/velocitai at commit dfcca7e, republished under its MIT licence (© DanielSuo117). 130 words, ~776 tokens.

Download SKILL.mdSave it as .claude/skills/page-load-assertion/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
page-load-assertion
description
is_page_loaded() 四种验证模式与调用层级。触发:页面断言、is_page_loaded、page loaded、页面加载验证。

Page Load Assertion — 页面加载断言方法论

核心思路

页面"正常"的判断不是检查 HTTP 状态码,而是验证用户能看到的关键元素确实渲染出来了。通过每个 PageObject 的 is_page_loaded() 方法统一实现。


is_page_loaded() 的四种验证模式

按严格程度从低到高:

模式 A:单元素验证(最简单)

检查该页面独有的标志性容器是否可见。适用于结构简单、一个元素就能区分的页面:

python
PAGE_CONTAINER = "css=.feature-container"    # P3

def is_page_loaded(self) -> bool:
    return self.is_visible(self.PAGE_CONTAINER)
模式 B:双元素 AND 组合(推荐默认)

容器 + 内容 双重验证,确保"页面骨架到位 + 数据渲染完成":

python
PAGE_CONTAINER = "css=.feature-container"    # P3
PAGE_TITLE = "text=欢迎使用"                  # P1

def is_page_loaded(self) -> bool:
    return self.is_visible(self.PAGE_CONTAINER) and self.is_visible(self.PAGE_TITLE)
模式 C:多元素 + 激活态验证(最严格)

在结构和内容基础上,还验证当前 UI 状态(如某个 tab 处于 active)。适用于承担"起点状态判断"语义的页面:

python
PAGE_TITLE = "css=span.page-title"                                    # P3
TAB_BAR = "css=ul.tab-bar"                                            # P3
DEFAULT_TAB_ACTIVE = "css=ul.tab-bar li.tab.active >> text=默认Tab"    # P3+P1

def is_page_loaded(self) -> bool:
    return (
        self.is_visible(self.PAGE_TITLE)
        and self.is_visible(self.TAB_BAR)
        and self.is_visible(self.DEFAULT_TAB_ACTIVE)
    )

注意:状态类 selector(.active / aria-selected 等)必须配 text 锁定,否则切换 tab 后 .active 跟随新激活对象漂移。

模式 D:委托给语义方法

把验证逻辑提取为有业务含义的方法名,便于 setup fixture 中单独调用:

python
def is_page_loaded(self) -> bool:
    return self.is_login_success()

def is_login_success(self) -> bool:
    return self.is_visible(self.SUCCESS_FLAG) and self.is_visible(self.NAV_LIST)

模式选择决策树

新页面需要 is_page_loaded()
│
├─ 页面结构简单,一个独有容器即可区分?
│  └─ 是 → 模式 A(单元素)
│
├─ 需要确认内容也渲染到位?
│  └─ 是 → 模式 B(容器 + 内容,推荐默认)
│
├─ 该页面是复位 fixture 的起点,需要判断 UI 状态?
│  └─ 是 → 模式 C(多元素 + 激活态)
│
├─ 验证逻辑在 setup 中也需要单独调用?
│  └─ 是 → 模式 D(委托给语义方法)
│
└─ 容器可能存在但内容未渲染(SPA 子 Tab 切换 / 异步加载)?
   └─ 是 → 模式 E(JS evaluate 检查子元素数量)

验证元素的选择原则

原则说明
选该页面独有的元素不选通用 header/footer,选只有这个页面才有的容器或文本
优先选结构性容器如 .feature-container、.detail-wrapper,页面骨架不易变
文本元素锁定业务语义如 text=欢迎使用,确认内容渲染到位
状态类 selector 配 text.active 会随操作漂移,必须加 >> text=具体文本 锁定
不选动态数据具体数字、用户名等因数据变化导致断言不稳定
断言目标的三级稳定性

核心原则:优先选模板级文本(页面框架固定标题),禁止选数据级内容(动态计数、日期)。多视图场景中每个断言目标须同时满足「模板级 + 视图独占」。

完整规则与反例/正例 → assertion-patterns.md "断言目标稳定性"章节。

模式 E:白屏检测 + 空数据 vs 有数据 三态判断

SPA 中容器 div 可能存在且 is_visible 为真,但内部组件未挂载(白屏)—— 此时模式 A/B 会误判为正常。该场景需要三态判断,细节较多且只在 SPA 下适用。

按需展开 → references/blank-screen-detection.md

调用层级

  1. class setup:登录后 assert home.is_page_loaded(), "首页加载失败"
  2. function reset:if not self.home.is_page_loaded(): click_nav_home(); assert ...
  3. 用例体:每次跳转后 assert target.is_page_loaded(), "<页面>加载失败"

规则约束

  1. 每个 PageObject 必须实现 is_page_loaded()——返回 bool,放在类的最后一个方法
  2. is_page_loaded() 内部只用 is_visible() 组合,不抛异常

© DanielSuo117, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/page-load-assertion of DanielSuo117/velocitai.

  • SKILL.md
  • references/blank-screen-detection.md

Open the folder on GitHubat commit dfcca7e

Compare with similar skills

Page Load Assertion next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Page Load Assertion compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Page Load Assertion this skillDanielSuo117/velocitai158—~776Automated safety check: PassMIT
Web Application Testinganthropics/skills180k51 repos~966Automated safety check: PassApache-2.0
Diagnosing Bugsfossasia/eventyay-interpretation1.6k32 repos~2.1kAutomated safety check: PassApache-2.0
TDDpietheinstrengholt/rssmonster56430 repos~906Automated safety check: PassMIT
TDD WorkflowhellangleZ/burn-in-cceverywhere-ralph11211 repos~2.4kAutomated safety check: PassNone
TDDsanity-io/sanity6.4k20 repos~1kAutomated safety check: PassMIT

Similar skills

  • Web Application Testing

    anthropics/skills

    Official

    Tests local web applications with Python Playwright scripts, checking frontend behavior, capturing screenshots and reading browser console logs.

    180k GitHub starsUsed in 51 repos~966 tokens
    Testing & QAAuto-check passed
  • Diagnosing Bugs

    fossasia/eventyay-interpretation

    Diagnosis loop for hard bugs and performance regressions. An agent skill from fossasia/eventyay-interpretation.

    1.6k GitHub starsUsed in 32 repos~2.1k tokens
    Testing & QAAuto-check passed
  • TDD

    pietheinstrengholt/rssmonster

    Test-driven development. An agent skill from pietheinstrengholt/rssmonster.

    564 GitHub starsUsed in 30 repos~906 tokens
    Testing & QAAuto-check passed
  • TDD Workflow

    hellangleZ/burn-in-cceverywhere-ralph

    A skill your agent uses when writing new features, fixing bugs, or refactoring code.

    112 GitHub starsUsed in 11 repos~2.4k tokens
    Testing & QAAuto-check passed
  • TDD

    sanity-io/sanity

    Official

    Test-driven development with red-green-refactor loop. An agent skill from sanity-io/sanity.

    6.4k GitHub starsUsed in 20 repos~1k tokens
    Testing & QAAuto-check passed
  • Context Driven Development

    Ibrahim-3d/orchestrator-supaconductor

    A skill your agent uses when working with Conductor's context-driven development methodology, managing project context artifacts, or understanding the relationship between product.md, tech-stack.md…

    380 GitHub starsUsed in 9 repos~2.9k tokens
    Testing & QAAuto-check passed

More from DanielSuo117/velocitai

All 13 skills in this repo
  • Architecture

    DanielSuo117/velocitai

    POM 分层与 context 共享决策树。触发:架构、分层、POM、Page Object、基类设计、新增角色. An agent skill from DanielSuo117/velocitai.

    158 GitHub stars~726 tokensUpdated 11 days ago
    Auto-check passed
  • Locator Replacer

    DanielSuo117/velocitai

    替换占位定位符为真实选择器(六级优先级)。触发:替换定位符、locator、selector、定位失败、元素找不到、DOM 分析。

    158 GitHub stars~703 tokensUpdated 11 days ago
    Auto-check passed
  • Quick Debug

    DanielSuo117/velocitai

    测试失败时免登跳转原地排查修复。触发:排查、纠错、debug、定位符失败、超时、元素找不到、断言失败. An agent skill from DanielSuo117/velocitai.

    158 GitHub stars~471 tokensUpdated 11 days ago
    Auto-check passed
  • Save Verify Strategy

    DanielSuo117/velocitai

    表单保存后验证(Toast / 重定向 / 数据对比 / 富文本清空)。触发:保存验证、toast、重定向检测、Meta+A、保存成功判断。

    158 GitHub stars~547 tokensUpdated 11 days ago
    Auto-check passed
  • Test Runner

    DanielSuo117/velocitai

    运行 pytest + 结构化分析失败原因。触发:运行测试、跑测试、run test、pytest、失败分析、allure。

    158 GitHub stars~404 tokensUpdated 11 days ago
    Auto-check passed
  • Add Regression Point

    DanielSuo117/velocitai

    为已有 PageObject 增量添加回归测试点。触发:新增测试点、添加回归点、add test point、增加覆盖、扩展页面方法。

    158 GitHub stars~639 tokensUpdated 11 days ago
    Auto-check passed

Categories

Questions about Page Load Assertion

What does Page Load Assertion do?

ispageloaded() 四种验证模式与调用层级。触发:页面断言、ispageloaded、page loaded、页面加载验证。. Page Load Assertion is an agent skill from DanielSuo117/velocitai.

When should I use Page Load Assertion?

Page Load Assertion fits situations like: testing & QA work in your project.

How do I install Page Load Assertion in Claude Code?

Run `npx skills add DanielSuo117/velocitai --skill page-load-assertion -a claude-code`. Or copy the skill folder (skills/page-load-assertion in DanielSuo117/velocitai) into .claude/skills/page-load-assertion in your project. Claude Code loads it when a task matches its description.

How do I install Page Load Assertion in Codex?

Run `npx skills add DanielSuo117/velocitai --skill page-load-assertion -a codex`. Or copy the skill folder (skills/page-load-assertion in DanielSuo117/velocitai) into .agents/skills/page-load-assertion in your project. Codex loads it when a task matches its description.

Can I use Page Load Assertion in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add DanielSuo117/velocitai --skill page-load-assertion -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/page-load-assertion, .gemini/skills/page-load-assertion, .github/skills/page-load-assertion and .opencode/skills/page-load-assertion in your project.

What does Page Load Assertion need to run?

SKILL.md names no scripts, command-line tools or credentials: Page Load Assertion is instructions for the agent only. Our summary lists: Python 3.

Does Page Load Assertion access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Page Load Assertion safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Page Load Assertion use?

Page Load Assertion is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Page Load Assertion use?

About 776 tokens (SKILL.md is roughly 3.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 847 tokens, read only when the agent opens those files.

What are the alternatives to Page Load Assertion?

Skills that share tags, products or a category with Page Load Assertion: Web Application Testing (anthropics/skills, 180k stars), Diagnosing Bugs (fossasia/eventyay-interpretation, 1.6k stars), TDD (pietheinstrengholt/rssmonster, 564 stars) and TDD Workflow (hellangleZ/burn-in-cceverywhere-ralph, 112 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Page Load Assertion?

DanielSuo117 (a GitHub user) maintains it in DanielSuo117/velocitai, which has 158 GitHub stars. The repository holds 13 skills in this directory. The repository was last updated on September 27, 2026.

Source: DanielSuo117/velocitai on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.