SOURCE / PINNED RELEASE
Made of little things.
Napcraft
- Release
- ee47ac6a25df…
- Author-recorded commit
- 410dea87e109…
- License
- LICENSE
- Author’s source reference
- nostr://npub182jczunncwe0jn6frpqwq3e0qjws7yqqnc3auccqv9nte2dnd63scjm4rf/wss%3A%2F%2Fgit.napplet.soy%2F/n-52f9e22f5ce
Archive hash verified: 9e6e0cabb18d0d46…. The source-to-build association is the author’s claim; it has not been independently rebuilt.
import { chromium, executable } from './browser-support.mjs';
import { writeFile } from 'node:fs/promises';
import assert from 'node:assert/strict';
const browser = await chromium.launch({
executablePath: executable,
headless: true,
});
try {
const page = await browser.newPage({
viewport: { width: 1200, height: 1000 },
});
await page.goto(process.env.NAPCRAFT_URL || 'http://127.0.0.1:51696/');
await page.locator('#view-listing').click();
const image = page.locator('#listing-content img');
await image.waitFor();
await image.evaluate((img) => img.decode());
assert.equal(await image.evaluate((img) => img.naturalWidth), 1200);
const video = page.locator('#listing-content video');
await video.waitFor();
const playback = await video.evaluate(async (el) => {
el.muted = true;
await el.play();
return new Promise((resolve, reject) => {
const timer = setTimeout(
() => reject(Error('Clip did not finish playback')),
15000,
);
el.onended = () => {
clearTimeout(timer);
resolve({
duration: el.duration,
width: el.videoWidth,
height: el.videoHeight,
ended: el.ended,
});
};
el.onerror = () => reject(Error('Video decode failed'));
});
});
assert.ok(playback.ended);
assert.equal(playback.width, 960);
assert.equal(playback.height, 600);
await page.screenshot({
path: '.napplet-space/promotion/listing-review.png',
fullPage: true,
});
await writeFile(
'.napplet-space/media-review.json',
JSON.stringify({ image: 'decoded 1200 × 750 PNG', playback }, null, 2),
);
console.log(
'PASS image decoded and full video played in soyLI Listing',
playback,
);
} finally {
await browser.close();
}
