sap-sac-test-automation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSAP Analytics Cloud Test Automation
SAP Analytics Cloud (SAC) 测试自动化
Design reusable SAC test automation as a capability-gated system: select the safest available discovery backend, require human review for profiles and baselines, then use reviewed Playwright code for deterministic execution, CI gating, reporting, and evidence.
Apply the core rule: discovery proposes, humans approve, Playwright executes, CI enforces.
将可复用的SAC测试自动化设计为基于能力管控的系统:选择最安全的可用发现后端,要求人工审核配置文件和基线,然后使用经过审核的Playwright代码进行确定性执行、CI管控、报告生成和证据留存。
遵循核心规则:发现提议,人工批准,Playwright执行,CI强制执行。
Related Skills
相关技能
- sap-sac-scripting: Use for Optimized Story Experience scripting, Analytics Designer APIs, diagnostic widgets, story script behavior, and SAC MCP setup.
- sap-sac-planning: Use for planning models, private/public versions, data actions, multi actions, validation rules, and writeback risk analysis.
- sap-sac-custom-widget: Use when dashboards include owned custom widgets that need stable ARIA labels, public test hooks, lifecycle fixes, or black-box test contracts.
- sap-dependency-security: Use before adding source-pinned browser tools, MCP servers, CI dependencies, or executable automation that handles SAC credentials.
- sap-browser-automation: Use for in-app manual authentication, consent-gated Edge profile reuse, fresh Edge/CDP startup, auth-state bootstrap, and browser recovery.
- agent-browser: Optionally load when the Vercel Labs agent-browser CLI is available and exact command syntax, snapshot/ref usage, screenshots, console, or network inspection is needed.
- playwright: Optionally load for CLI-based browser driving and debugging. For durable suites, use this SAC skill as the test architecture guide and follow the local project's Playwright conventions.
@playwright/test - chrome-devtools: Optionally load when Chrome DevTools MCP is installed and approved for read-only browser discovery, console/network inspection, screenshots, Lighthouse, or performance traces. Use for SAC-safe defaults and Edge boundaries.
references/chrome-devtools-mcp.md
- sap-sac-scripting: 用于优化报表体验脚本、Analytics Designer API、诊断组件、报表脚本行为和SAC MCP设置。
- sap-sac-planning: 用于规划模型、私有/公共版本、数据操作、多操作、验证规则和回写风险分析。
- sap-sac-custom-widget: 当仪表盘包含自有自定义组件,需要稳定ARIA标签、公共测试钩子、生命周期修复或黑盒测试合同时使用。
- sap-dependency-security: 在添加固定源的浏览器工具、MCP服务器、CI依赖项或处理SAC凭证的可执行自动化之前使用。
- sap-browser-automation: 用于应用内手动认证、需授权的Edge配置文件复用、全新Edge/CDP启动、认证状态引导和浏览器恢复。
- agent-browser: 当Vercel Labs agent-browser CLI可用,且需要精确命令语法、快照/引用使用、截图、控制台或网络检查时,可选择加载。
- playwright: 用于基于CLI的浏览器驱动和调试时可选择加载。对于持久化的套件,将此SAC技能作为测试架构指南,并遵循本地项目的Playwright约定。
@playwright/test - chrome-devtools: 当Chrome DevTools MCP已安装并获准用于只读浏览器发现、控制台/网络检查、截图、Lighthouse或性能追踪时,可选择加载。使用获取SAC安全默认设置和Edge边界限制。
references/chrome-devtools-mcp.md
Initial Guidance
初始指引
When the user is starting SAC automation or has not supplied a reviewed dashboard profile, route them through or follow the same intake sequence manually. Use a two-stage intake:
/sac-test-onboard- Stage 1: environment class, tenant risk, allowed discovery/execution tools, auth and roles, writeback/comment scope, and baseline ownership.
- Stage 2: planning/writeback, comments, permissions, visual/data baselines, custom widgets, CI stages, and failure evidence.
Default to draft-only artifacts until the user explicitly confirms file creation and target directory. If writing is confirmed, use , , and based on the bundled templates.
profiles/<profile-id>/intake.mdprofiles/<profile-id>/dashboard.yamlprofiles/<profile-id>/scenarios/read-only-smoke.yamlAfter a profile or scenario draft exists, route safety review to when available. Keep the reviewer focused on intake/profile/scenario safety, not broad Playwright suite implementation.
sac-test-profile-reviewer当用户开始SAC自动化或未提供经过审核的仪表盘配置文件时,引导他们通过或手动遵循相同的引入流程。采用两阶段引入:
/sac-test-onboard- 第一阶段:环境类别、租户风险、允许的发现/执行工具、认证和角色、回写/评论范围,以及基线所有权。
- 第二阶段:规划/回写、评论、权限、视觉/数据基线、自定义组件、CI阶段和故障证据。
默认仅生成草稿工件,直到用户明确确认文件创建和目标目录。如果确认写入,基于捆绑模板使用、和。
profiles/<profile-id>/intake.mdprofiles/<profile-id>/dashboard.yamlprofiles/<profile-id>/scenarios/read-only-smoke.yaml当配置文件或场景草稿存在时,若可用,将安全审核路由至该角色。让审核者专注于引入/配置文件/场景的安全性,而非宽泛的Playwright套件实现。
sac-test-profile-reviewerWhen to Use This Skill
何时使用此技能
Use this skill to plan, implement, or review SAC automation involving:
- SAC stories, optimized stories, reports, dashboards, tabs, filters, prompts, tables, charts, exports, scripts, comments, or bookmarks.
- Dashboard profile files, scenario YAML, expected data files, visual baselines, Playwright adapters, and SAC-specific fixtures.
- Stored authentication state, SSO/MFA constraints, role-based test users, permission matrices, and CI gates.
- Planning writeback, private/public versions, data locks, validation rules, data actions, multi actions, or comment cleanup.
- Failure packets with traces, screenshots, videos, visual diffs, expected-vs-actual values, console/network summaries, and root-cause classification.
Do not use this skill as the main guide for generic web applications. Use general Playwright guidance for non-SAC sites.
在规划、实施或审核涉及以下内容的SAC自动化时使用此技能:
- SAC报表、优化报表、报告、仪表盘、标签页、过滤器、提示、表格、图表、导出、脚本、评论或书签。
- 仪表盘配置文件、场景YAML、预期数据文件、视觉基线、Playwright适配器和SAC特定夹具。
- 存储的认证状态、SSO/MFA约束、基于角色的测试用户、权限矩阵和CI管控。
- 规划回写、私有/公共版本、数据锁定、验证规则、数据操作、多操作或评论清理。
- 包含追踪信息、截图、视频、视觉差异、预期与实际值、控制台/网络摘要以及根因分类的故障数据包。
不要将此技能作为通用Web应用的主要指南。对于非SAC站点,使用通用Playwright指引。
Quick Start
快速开始
- Classify the SAC story: production read-only, QA clone, planning/writeback, comments, permission-sensitive, or exploratory.
- Establish the automation policy: allowed tenants, allowed users, auth storage handling, writeback approval, baseline approval, and CI triggers.
- Run the capability and policy gate: choose manual discovery, Firecrawl public research, Chrome DevTools MCP with supported Chrome, Microsoft Edge/CDP, Chrome DevTools MCP with Edge best-effort, Playwright, agent-browser, or an approved enterprise browser lab based on what is installed and allowed.
- Run read-only discovery with the selected backend: capture snapshots, annotated screenshots, console/page errors, network clues, and candidate component maps without sending private SAC content to unapproved external services.
- Convert discovery into a human-reviewed dashboard profile: pages, widgets, locators, readiness markers, roles, data baselines, visual baselines, and known restrictions.
- Implement deterministic Playwright tests through reusable adapters. Keep scenario files selector-free; route interactions through component IDs from the profile.
- Gate only safe packs in CI first: auth check, read-only smoke, navigation, and critical widget readiness. Move planning, comments, data actions, visual baselines, and full permissions to controlled/nightly stages.
- Emit reviewer-friendly failure evidence: HTML report, trace, screenshots, video, visual diff, widget metadata, expected vs actual values, and failure category.
- 对SAC报表进行分类:生产只读、QA克隆、规划/回写、评论、权限敏感或探索性。
- 制定自动化策略:允许的租户、允许的用户、认证存储处理、回写审批、基线审批和CI触发器。
- 运行能力和策略管控:根据已安装和允许的工具,选择手动发现、Firecrawl公共研究、支持Chrome的Chrome DevTools MCP、Microsoft Edge/CDP、基于Edge最佳实践的Chrome DevTools MCP、Playwright、agent-browser或经批准的企业浏览器实验室。
- 使用选定的后端运行只读发现:捕获快照、带注释的截图、控制台/页面错误、网络线索和候选组件映射,不要将私有SAC内容发送给未获批准的外部服务。
- 将发现结果转换为人工审核的仪表盘配置文件:页面、组件、定位器、就绪标记、角色、数据基线、视觉基线和已知限制。
- 通过可复用适配器实现确定性Playwright测试。场景文件中避免使用选择器;通过配置文件中的组件ID路由交互。
- 首先在CI中仅管控安全包:认证检查、只读冒烟测试、导航和关键组件就绪性。将规划、评论、数据操作、视觉基线和完整权限移至受控/夜间阶段。
- 生成便于审核的故障证据:HTML报告、追踪信息、截图、视频、视觉差异、组件元数据、预期与实际值以及故障类别。
Read-Only Story Acceptance
只读报表验收
Apply this contract to reporting-only SAC stories and dashboards. It complements the profile-driven smoke scenario and does not authorize planning or model changes.
将此契约应用于仅用于报告的SAC报表和仪表盘。它补充了基于配置文件的冒烟场景,不授权规划或模型更改。
Tenant and Model Safety
租户和模型安全
- Confirm the approved tenant, story, and data source/model before interaction.
- Verify that the current SAC area is Story Designer, not Modeler.
- Confirm that no model edit dialog, model save, master-data change, permission change, planning writeback, version publish, data action, multi action, or lock change occurred.
- Bind assertions only to dimensions, measures, hierarchies, filters, and comparison categories exposed by the approved model. If a required field is unavailable, omit the dependent widget and record the omission.
- 在交互前确认已批准的租户、报表和数据源/模型。
- 验证当前SAC区域为报表设计器,而非模型器。
- 确认未发生模型编辑对话框打开、模型保存、主数据更改、权限更改、规划回写、版本发布、数据操作、多操作或锁定更改。
- 仅将断言绑定到已批准模型暴露的维度、度量、层级、过滤器和比较类别。如果所需字段不可用,忽略相关组件并记录该情况。
Story Readiness
报表就绪性
- Open each page and wait for page-specific readiness markers, spinner disappearance, stable widget state, and the absence of visible SAC error messages.
- Verify that every KPI, chart, and table displays values or an explicit no-data state; loading completion alone is not sufficient.
- Confirm that filters populate, accept valid values, and update dependent widgets without changing the model.
- Exercise approved selections, navigation, and drilldowns where configured; verify that the resulting table or chart state is consistent.
- Record unresolved widgets, invalid bindings, unavailable fields, relevant console or network errors, and tenant-specific limitations.
- 打开每个页面,等待页面特定的就绪标记、加载 spinner 消失、组件状态稳定,且无可见的SAC错误消息。
- 验证每个KPI、图表和表格都显示值或明确的无数据状态;仅完成加载不足以判定就绪。
- 确认过滤器已填充、接受有效值,且在不更改模型的情况下更新相关组件。
- 在配置范围内执行已批准的选择、导航和钻取;验证生成的表格或图表状态一致。
- 记录未解决的组件、无效绑定、不可用字段、相关控制台或网络错误,以及租户特定限制。
Evidence
证据
- Capture an approved screenshot or equivalent artifact for each story page and retain the story name and location.
- Pair visual evidence with KPI, table, or data assertions; do not use chart pixels as the only business-value check.
- Redact tenant identifiers, story IDs, session-like URL parameters, credentials, cookies, private screenshots, and unrelated tab content.
- 为每个报表页面捕获已批准的截图或等效工件,并保留报表名称和位置。
- 将视觉证据与KPI、表格或数据断言配对;不要仅将图表像素作为业务价值检查的依据。
- 编辑租户标识符、报表ID、类会话URL参数、凭证、Cookie、私有截图和无关标签页内容。
Browser Failure and Honest Handoff
浏览器故障与可靠移交
Browser access is an execution prerequisite, not evidence that the story exists. If browser initialization or discovery fails, including runtime errors such as :
agent is not defined- Read the selected browser troubleshooting guidance and retry discovery without bypassing authentication or tenant permissions.
- If the normal browser path remains unavailable, use and the approved Microsoft Edge/CDP recovery guidance in
sap-browser-automation.references/edge-cdp-enterprise.md - If Edge/CDP is unavailable or blocked by policy, use approved desktop/manual assistance when available; ask the user to sign in interactively and never automate MFA.
- If authenticated tenant control still cannot be established, mark execution as blocked. Do not claim that the story was created or verified.
- Hand off an implementation-ready specification containing the story purpose and audience, confirmed model metadata, page-by-page widgets and filters, interactions, omitted or unresolved fields, read-only constraints, and the verification evidence still required.
浏览器访问是执行的前提条件,而非报表存在的证据。如果浏览器初始化或发现失败,包括等运行时错误:
agent is not defined- 查阅选定浏览器的故障排除指南,在不绕过认证或租户权限的情况下重试发现。
- 如果常规浏览器路径仍不可用,使用和
sap-browser-automation中的已批准Microsoft Edge/CDP恢复指南。references/edge-cdp-enterprise.md - 如果Edge/CDP不可用或被策略阻止,在可用时使用已批准的桌面/手动协助;要求用户交互式登录,绝不要自动化MFA。
- 如果仍无法建立已认证的租户控制,标记执行为受阻状态。不要声称报表已创建或验证。
- 移交包含报表用途和受众、已确认的模型元数据、逐页组件和过滤器、交互、忽略或未解决的字段、只读约束以及仍需的验证证据的可实施规范。
Operating Model
运营模型
Treat AI/browser-agent output as a draft, not as the source of truth. Require human review for profile creation, selector approval, expected business values, visual/data baseline changes, permission matrices, and any destructive/writeback scenario.
Prefer profile-driven automation:
- Store tenant/story metadata, pages, components, roles, baselines, and test policies in versioned YAML/JSON.
- Implement adapters for SAC component types such as buttons, tables, charts, tabs, filters, prompts, planning tables, comments, custom widgets, exports, and bookmarks.
- Keep selectors out of scenario files. Scenarios should call component IDs and actions, while adapters resolve locators and readiness behavior.
- Start with serial execution for each dashboard. Increase parallelism only after proving isolation for auth state, tenant state, comments, planning versions, live connections, and backend capacity.
将AI/浏览器代理输出视为草稿,而非事实来源。要求人工审核配置文件创建、选择器批准、预期业务值、视觉/数据基线更改、权限矩阵以及任何破坏性/回写场景。
优先采用基于配置文件的自动化:
- 将租户/报表元数据、页面、组件、角色、基线和测试策略存储在版本化的YAML/JSON中。
- 为SAC组件类型实现适配器,如按钮、表格、图表、标签页、过滤器、提示、规划表格、评论、自定义组件、导出和书签。
- 场景文件中避免使用选择器。场景应调用组件ID和操作,而适配器负责解析定位器和就绪行为。
- 每个仪表盘先采用串行执行。仅在证明认证状态、租户状态、评论、规划版本、实时连接和后端容量的隔离性后,再提高并行度。
Bundled Resources
捆绑资源
Load these references only as needed:
- : hybrid architecture, feasibility boundaries, reliable SAC test categories, and reusable project shape.
references/architecture.md - : backend decision matrix, Windows/restricted-environment checks, Firecrawl public-research policy, and no-tool fallbacks.
references/tool-availability-and-deployment.md - : Chrome DevTools MCP modes, SAC-safe configuration, tool categories, CLI usage, Windows/restricted deployment, and enterprise safety boundaries.
references/chrome-devtools-mcp.md - : SAC test-automation add-on for the shared
references/edge-cdp-enterprise.mdauthentication, profile-copy, Edge/CDP, and recovery layer.sap-browser-automation - : dashboard profile contract, scenario contract, adapter responsibilities, and onboarding flow.
references/dashboard-profiles-and-scenarios.md - : optional agent-browser read-only discovery workflow, command patterns, output artifacts, and human review checklist.
references/agent-browser-discovery.md - : Playwright test runner guidance, auth, readiness, CI stages, and test category policy.
references/playwright-execution.md - : SAC testability contract, auth/SSO, planning/comment safety, baseline approval, and role governance.
references/governance-and-sac-testability.md - : required evidence, failure packet shape, root-cause categories, and performance/readiness metrics.
references/failure-triage-and-artifacts.md - : guided intake packet for policy, tooling, roles, risk, baselines, and approvals.
templates/intake.md - : starter dashboard profile with SAC metadata, readiness, components, roles, baselines, and risk policy.
templates/dashboard-profile.yaml - : selector-free starter smoke scenario using profile component IDs.
templates/scenario-read-only-smoke.yaml
When implementing against a live project, also inspect the project's existing Playwright config, package manager, CI, profile schema, and artifact conventions before adding new structure.
仅在需要时加载以下参考资料:
- :混合架构、可行性边界、可靠SAC测试类别和可复用项目结构。
references/architecture.md - :后端决策矩阵、Windows/受限环境检查、Firecrawl公共研究策略和无工具 fallback 方案。
references/tool-availability-and-deployment.md - :Chrome DevTools MCP模式、SAC安全配置、工具类别、CLI使用、Windows/受限部署和企业安全边界。
references/chrome-devtools-mcp.md - :共享
references/edge-cdp-enterprise.md认证、配置文件复制、Edge/CDP和恢复层的SAC测试自动化扩展。sap-browser-automation - :仪表盘配置文件契约、场景契约、适配器职责和接入流程。
references/dashboard-profiles-and-scenarios.md - :可选的agent-browser只读发现工作流、命令模式、输出工件和人工审核清单。
references/agent-browser-discovery.md - :Playwright测试运行器指引、认证、就绪性、CI阶段和测试类别策略。
references/playwright-execution.md - :SAC可测试性契约、认证/SSO、规划/评论安全、基线批准和角色治理。
references/governance-and-sac-testability.md - :所需证据、故障数据包结构、根因类别和性能/就绪性指标。
references/failure-triage-and-artifacts.md - :用于策略、工具、角色、风险、基线和审批的引导引入包。
templates/intake.md - :包含SAC元数据、就绪性、组件、角色、基线和风险策略的入门仪表盘配置文件。
templates/dashboard-profile.yaml - :使用配置文件组件ID的无选择器入门冒烟场景。
templates/scenario-read-only-smoke.yaml
在针对实际项目实施时,在添加新结构之前,还需检查项目现有的Playwright配置、包管理器、CI、配置文件架构和工件约定。
Common Issues
常见问题
- Avoid generated SAC DOM IDs and private framework classes. Prefer visible labels, ARIA roles, text, widget metadata, profile component IDs, and reviewed fallbacks.
- Do not treat story shell load as widget readiness. Wait for page markers, critical widgets, absence of SAC error text, spinner disappearance, stable values, and retrying assertions.
- Do not automate MFA as a release dependency. Prefer stored auth state, dedicated test users, security-approved test IdP policy, or manual refresh.
- Do not run comments, planning writeback, public version publish, data actions, or multi actions against production unless there is explicit formal approval.
- Do not approve visual or data drift automatically. Require owner review, baseline reason, and pull-request evidence.
- Do not use chart pixels as the only business-value assertion. Pair chart screenshots with table/KPI/data assertions where possible.
- Do not assume agent-browser, Playwright CLI, Chrome DevTools MCP, Firecrawl MCP, public npm, browser downloads, or remote debugging are available in company environments. Use the capability gate and document fallbacks.
- Do not use Chrome DevTools MCP as the audited CI release gate. Use it for discovery/debugging; convert approved findings into profile-driven Playwright tests.
- Do not run Chrome DevTools MCP against private SAC without disabling usage statistics, update checks, and CrUX field-data lookups, and without applying profile, URL, screenshot, and network-output controls.
- Do not expose CDP beyond loopback, publish , or bypass Edge
webSocketDebuggerUrlpolicy. Attaching to or copying a daily user profile requires explicit approval and the shared skill's isolated-profile procedure.RemoteDebuggingAllowed - Do not treat or
/json/versionreturning/json/listas proof that Edge CDP is unusable; read404and use the direct browser WebSocket only when the harness supports it.DevToolsActivePort - Do not send authenticated SAC tenant pages, screenshots, HARs, cookies, storage state, internal URLs, customer data, or private company docs to Firecrawl unless the exact deployment and retention mode are approved.
- Do not assume SAC optimized story features, tenant configuration, live data, localization, or prompt persistence behave identically across customers.
- 避免使用生成的SAC DOM ID和私有框架类。优先使用可见标签、ARIA角色、文本、组件元数据、配置文件组件ID和经过审核的 fallback 方案。
- 不要将报表外壳加载视为组件就绪。等待页面标记、关键组件、无SAC错误文本、spinner消失、值稳定,并重试断言。
- 不要将MFA自动化作为发布依赖项。优先使用存储的认证状态、专用测试用户、安全批准的测试IdP策略或手动刷新。
- 除非有明确的正式批准,否则不要在生产环境中运行评论、规划回写、公共版本发布、数据操作或多操作。
- 不要自动批准视觉或数据偏移。要求所有者审核、基线变更原因和拉取请求证据。
- 不要仅将图表像素作为业务价值断言的依据。尽可能将图表截图与表格/KPI/数据断言配对。
- 不要假设agent-browser、Playwright CLI、Chrome DevTools MCP、Firecrawl MCP、公共npm、浏览器下载或远程调试在企业环境中可用。使用能力管控并记录fallback方案。
- 不要将Chrome DevTools MCP作为经过审计的CI发布管控工具。将其用于发现/调试;将已批准的发现结果转换为基于配置文件的Playwright测试。
- 在针对私有SAC运行Chrome DevTools MCP时,必须禁用使用统计、更新检查和CrUX字段数据查询,并应用配置文件、URL、截图和网络输出控制。
- 不要将CDP暴露到环回地址之外,不要发布,或绕过Edge的
webSocketDebuggerUrl策略。附加或复制日常用户配置文件需要明确批准,并遵循共享技能的隔离配置文件流程。RemoteDebuggingAllowed - 不要将或
/json/version返回/json/list视为Edge CDP不可用的证明;读取404,仅当工具支持时才使用直接浏览器WebSocket。DevToolsActivePort - 除非确切的部署和保留模式已获批准,否则不要将已认证的SAC租户页面、截图、HAR文件、Cookie、存储状态、内部URL、客户数据或私有企业文档发送给Firecrawl。
- 不要假设SAC优化报表功能、租户配置、实时数据、本地化或提示持久性在不同客户之间表现一致。
Source and Verification Notes
来源和验证说明
Derived from incorporated SAC automated-suite planning content recorded in , plus extracted profile/scenario templates bundled with this skill. The planning sources cite SAP Help, Vercel Labs agent-browser, and Playwright documentation. Edge/CDP and Chrome DevTools MCP guidance also considers the README, CLI docs, tool reference, troubleshooting guide, package metadata, bundled skills, issue #1235 and PR #1229, Microsoft Edge DevTools Protocol documentation, Microsoft Edge DevTools MCP guidance, Edge policy, and Firecrawl public documentation for MCP/search/scrape safety. This skill is docs-audited only; live SAC tenant execution, Chrome DevTools MCP runtime behavior, SSO behavior, CI behavior, planning writeback, and visual baseline stability remain tenant-specific and must be validated before making runtime claims.
docs/project/sac-test-automation-source-review-2026-06-17.mdChromeDevTools/chrome-devtools-mcpRemoteDebuggingAllowed此技能源自中记录的已整合SAC自动化套件规划内容,以及与此技能捆绑的提取配置文件/场景模板。规划来源引用了SAP帮助文档、Vercel Labs agent-browser和Playwright文档。Edge/CDP和Chrome DevTools MCP指引还考虑了的README、CLI文档、工具参考、故障排除指南、包元数据、捆绑技能、Issue #1235和PR #1229、Microsoft Edge DevTools协议文档、Microsoft Edge DevTools MCP指引、Edge的策略,以及Firecrawl关于MCP/搜索/爬取安全的公共文档。此技能仅经过文档审计;实际SAC租户执行、Chrome DevTools MCP运行时行为、SSO行为、CI行为、规划回写和视觉基线稳定性仍因租户而异,在做出运行时声明前必须进行验证。
docs/project/sac-test-automation-source-review-2026-06-17.mdChromeDevTools/chrome-devtools-mcpRemoteDebuggingAllowed