サンプル
playwright 1.63.0
検証済みサンプル — npm playwright 1.63.0. node 22 · linux debian/x64 · docker で contract を実行し、成功しました: chromium, firefox, and webkit browser types provide expected…
sha256:d5e9d11d35391f53bd06aa71c11eef57188f162b3d4547defb0ca3d142c212a5
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 1
- ビルドした署名鍵
- 1
宣言された環境
linux 24 · ubuntu · glibc 2.39 x64 npm
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| node 22 · linux debian/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22@sha256:8a34c4ab3ea2… |
2026-09-10 |
ケース
HOW- ゴール
- verify pkg:npm/playwright@1.63.0
- パッケージ
- 作成日
- 2026-09-10T17:27:14Z
コントラクト
- chromium, firefox, and webkit browser types provide expected type names
- devices dictionary exposes mobile device emulation profiles
- errors namespace exports TimeoutError error class
- request APIRequestContext sends HTTP GET requests and parses JSON responses
- request APIRequestContext supports POST requests with JSON payload
- request APIRequestContext handles non-ok status codes and text responses
ファイル
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
ソース
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify pkg:npm/playwright@1.63.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/playwright@1.63.0
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:3942bed4780aa5fce744f527f2ccf432f45846b641749064350e55a87e22fbbb","contract":["chromium, firefox, and webkit browser types provide expected type names","devices dictionary exposes mobile device emulation profiles","errors namespace exports TimeoutError error class","request APIRequestContext sends HTTP GET requests and parses JSON responses","request APIRequestContext supports POST requests with JSON payload","request APIRequestContext handles non-ok status codes and text responses"],"goal":"verify pkg:npm/playwright@1.63.0","kind":"HOW","packages":["pkg:npm/playwright@1.63.0"],"schemaVersion":1},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/playwright@1.63.0"],"schemaVersion":1,"subject":"pkg:npm/playwright@1.63.0","verifierAdapter":"node-typescript@1"}
{
"name": "playwright-sample",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playwright-sample",
"version": "1.0.0",
"dependencies": {
"playwright": "1.63.0"
}
},
"node_modules/playwright": {
"version": "1.63.0",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.63.0.tgz",
"integrity": "sha512-+7ziBLidS4NaNCdt57SUDT+wYmmd5fmiQejUic/kb+YsYSCPyOOE9sebzMjNmQrsnNpDJqd4WHvV/8lfKfUDUg==",
"license": "Apache-2.0",
"dependencies": {
"playwright-core": "1.63.0"
},
"bin": {
"playwright": "cli.js"
},
"engines": {
"node": ">=20"
}
},
"node_modules/playwright-core": {
"version": "1.63.0",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.63.0.tgz",
"integrity": "sha512-rYCsBF/M5HjUch52bbtVONEFjv6Xu8sm8h72dNlR5bzIE1fvC/bxgspzkjSfU+MweEMmPM8KJebG6nnyxo5mCg==",
"license": "Apache-2.0",
"bin": {
"playwright-core": "cli.js"
},
"engines": {
"node": ">=20"
}
}
}
}
{
"name": "playwright-sample",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification for playwright",
"dependencies": {
"playwright": "1.63.0"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/playwright@1.63.0",
"kind": "HOW",
"packages": [
"pkg:npm/playwright@1.63.0"
]
}
import assert from 'node:assert';
import http from 'node:http';
import { chromium, firefox, webkit, devices, errors, request } from 'playwright';
// 1. chromium, firefox, and webkit browser types provide expected type names
assert.strictEqual(chromium.name(), 'chromium');
assert.strictEqual(firefox.name(), 'firefox');
assert.strictEqual(webkit.name(), 'webkit');
// 2. devices dictionary exposes mobile device emulation profiles
assert.ok('iPhone 12' in devices);
const iphone = devices['iPhone 12'];
assert.ok(iphone.userAgent.includes('iPhone'));
assert.strictEqual(typeof iphone.viewport.width, 'number');
assert.strictEqual(typeof iphone.viewport.height, 'number');
assert.strictEqual(iphone.isMobile, true);
assert.strictEqual(iphone.hasTouch, true);
// 3. errors namespace exports TimeoutError error class
assert.ok(errors.TimeoutError);
const timeoutErr = new errors.TimeoutError('operation timed out');
assert.ok(timeoutErr instanceof Error);
assert.strictEqual(timeoutErr.name, 'TimeoutError');
// 4. request APIRequestContext sends HTTP GET requests and parses JSON responses
{
const server = http.createServer((req, res) => {
if (req.url === '/api/status') {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({ status: 'ok', version: '1.63.0' }));
return;
}
res.writeHead(404);
res.end();
});
await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve));
const port = server.address().port;
try {
const context = await request.newContext({ baseURL: `http://127.0.0.1:${port}` });
const res = await context.get('/api/status');
assert.strictEqual(res.status(), 200);
assert.strictEqual(res.ok(), true);
const data = await res.json();
assert.strictEqual(data.status, 'ok');
assert.strictEqual(data.version, '1.63.0');
await context.dispose();
} finally {
await new Promise((resolve) => server.close(resolve));
}
}
// 5. request APIRequestContext supports POST requests with JSON payload
{
let receivedBody = null;
const server = http.createServer((req, res) => {
let body = '';
req.on('data', (chunk) => {
body += chunk;
});
req.on('end', () => {
receivedBody = JSON.parse(body);
res.writeHead(201, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({ received: true, echo: receivedBody }));
});
});
await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve));
const port = server.address().port;
try {
const context = await request.newContext({ baseURL: `http://127.0.0.1:${port}` });
const res = await context.post('/api/echo', {
data: { test: 'playwright-contract' },
});
assert.strictEqual(res.status(), 201);
const data = await res.json();
assert.strictEqual(data.received, true);
assert.deepStrictEqual(data.echo, { test: 'playwright-contract' });
await context.dispose();
} finally {
await new Promise((resolve) => server.close(resolve));
}
}
// 6. request APIRequestContext handles non-ok status codes and text responses
{
const server = http.createServer((req, res) => {
res.writeHead(404, { 'Content-Type': 'text/plain' });
res.end('Not Found Here');
});
await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve));
const port = server.address().port;
try {
const context = await request.newContext({ baseURL: `http://127.0.0.1:${port}` });
const res = await context.get('/missing');
assert.strictEqual(res.status(), 404);
assert.strictEqual(res.ok(), false);
const text = await res.text();
assert.strictEqual(text, 'Not Found Here');
await context.dispose();
} finally {
await new Promise((resolve) => server.close(resolve));
}
}
console.log('Contract passed');
オリジンシーダー
匿名