SOURCE / PINNED RELEASE
Made of little things.
Body Journal
- Release
- e8049f8da4e2…
- Author-recorded commit
- 61c04bf0e8aa…
- License
- LICENSE
- Author’s source reference
- nostr://npub182jczunncwe0jn6frpqwq3e0qjws7yqqnc3auccqv9nte2dnd63scjm4rf/wss%3A%2F%2Fgit.napplet.soy%2F/n-6c4554844c7
Archive hash verified: 4369d778da046a8b…. The source-to-build association is the author’s claim; it has not been independently rebuilt.
import assert from 'node:assert/strict';
import {createRequire} from 'node:module';
import {realpathSync} from 'node:fs';
import {mkdir,writeFile} from 'node:fs/promises';
import {execFileSync} from 'node:child_process';
const require=createRequire(realpathSync('node_modules/@napplet/conformance-cli/package.json'));
const {chromium}=require('playwright');
const info=JSON.parse(execFileSync('soyli',['browser','path','--json'],{encoding:'utf8'}));
const browser=await chromium.launch({executablePath:info.executables.find(e=>e.name==='chromium'&&e.installed).path,headless:true});
const output='.napplet-space/anatomy-checks';await mkdir(output,{recursive:true});
try{
const page=await browser.newPage({viewport:{width:1400,height:950}}),errors=[];
page.on('pageerror',e=>errors.push(e.message));await page.goto(process.argv[2]);
const iframe=page.locator('iframe');await iframe.waitFor();
await iframe.evaluate(e=>e.style.cssText='position:fixed;inset:0;width:1400px;height:950px;z-index:9999;border:0');
let f=await(await iframe.elementHandle()).contentFrame();await f.locator('#app[data-ready="true"]').waitFor();
await f.locator('#sex').selectOption('Male');await f.locator('#focusPelvis').click();await f.locator('[data-mode="paint"]').click();
let box=await f.locator('canvas').boundingBox();
await page.mouse.click(box.x+box.width*.5,box.y+box.height*.5);
assert.match(await f.locator('#location').inputValue(),/Penis/);
await f.locator('#description').fill('Synthetic anatomy UI test.');
await f.getByRole('button',{name:'Sitting',exact:true}).click();
await f.locator('#newConcern').click();await f.getByRole('button',{name:'Standing',exact:true}).click();await f.locator('[data-view="front"]').click();
box=await f.locator('canvas').boundingBox();let found=false;
for(const y of [.35,.4,.45]){
await page.mouse.move(box.x+box.width*.5,box.y+box.height*y);
if(/chest/.test(await f.locator('#sceneHint').innerText())){await page.mouse.click(box.x+box.width*.5,box.y+box.height*y);found=true;break;}
}
assert.ok(found,'Can mark a separate chest observation');assert.equal(await f.locator('#concernCount').innerText(),'2');
await f.locator('#connectionsButton').click();await f.locator('#apiKey').fill('dummy-anatomy-test');await f.locator('#bridgePubkey').fill('a'.repeat(64));await f.locator('#bridgeTrust').check();
await f.locator('#closeModal').click();await f.locator('[data-page="review"]').first().click();await f.locator('[data-ai="request"]').click();
assert.equal(await f.locator('.evidence-gallery img').count(),2);
const captions=await f.locator('.evidence-gallery figcaption').allTextContents();assert.match(captions[0],/Saved sitting pose/);assert.match(captions[1],/Saved standing pose/);
assert.equal(await f.locator('[data-ai="send"]').count(),0,'No image sending without a visual test');
for(let i=0;i<2;i++){const data=await f.locator('.evidence-gallery img').nth(i).getAttribute('src');await writeFile(`${output}/observation-${i+1}.jpg`,Buffer.from(data.split(',')[1],'base64'));}
await f.locator('#closeModal').click();await f.locator('[data-page="map"]').first().click();
assert.equal(await f.locator('[data-pose="standing"]').getAttribute('aria-pressed'),'true','Capture restores current pose');
await f.locator('#sex').selectOption('Female');await f.locator('#focusPelvis').click();await f.locator('#newConcern').click();await f.locator('#brushSize').fill('4');
box=await f.locator('canvas').boundingBox();
await page.mouse.click(box.x+box.width*.525,box.y+box.height*.52);
assert.match(await f.locator('#location').inputValue(),/labium/i);
await iframe.screenshot({path:`${output}/female-painted.png`});
await f.waitForFunction(()=>document.querySelector('#sessionStatus').textContent==='Session saved');await page.reload();
await iframe.waitFor();f=await(await iframe.elementHandle()).contentFrame();await f.locator('#app[data-ready="true"]').waitFor();
assert.equal(await f.locator('#sex').inputValue(),'Female');assert.equal(await f.locator('#concernCount').innerText(),'3');assert.match(await f.locator('#location').inputValue(),/labium/i);
assert.deepEqual(errors,[]);console.log('PASS: male/female external surface painting, anatomy reload, saved sitting/standing image poses, restored UI pose, and unverified-image send gate; no vendor requests.');
}finally{await browser.close();}
