fix(release): retire legacy capture publisher
This commit is contained in:
parent
547d4ad97a
commit
ec5aec758b
1 changed files with 13 additions and 103 deletions
|
|
@ -1,107 +1,17 @@
|
||||||
const { chromium, devices } = require('playwright');
|
'use strict';
|
||||||
const path = require('path');
|
|
||||||
const fs = require('fs');
|
|
||||||
const http = require('http');
|
|
||||||
|
|
||||||
function serveStatic(dir, port) {
|
// This filename is retained only so old operator notes fail closed. The former
|
||||||
const server = http.createServer((req, res) => {
|
// script assembled a debug build, re-signed it, copied it into public release
|
||||||
let filePath = path.join(dir, req.url.split('?')[0]);
|
// directories, uploaded it, rewrote download links, and deployed the site.
|
||||||
if (filePath.endsWith('/') || !path.extname(filePath)) filePath = path.join(dir, 'index.html');
|
// None of those actions are permitted outside the signed-evidence release job.
|
||||||
|
const LEGACY_MOBILE_RELEASE_PIPELINE_DISABLED = true;
|
||||||
|
|
||||||
fs.readFile(filePath, (err, data) => {
|
if (require.main === module) {
|
||||||
if (err) {
|
process.stderr.write(
|
||||||
res.writeHead(404);
|
'Legacy mobile publication is disabled. Use .github/workflows/release.yml; '
|
||||||
res.end('Not found');
|
+ 'production artifacts require signed release evidence and create-only publication.\n',
|
||||||
return;
|
);
|
||||||
}
|
process.exitCode = 1;
|
||||||
const ext = path.extname(filePath);
|
|
||||||
const mimeTypes = {
|
|
||||||
'.html': 'text/html; charset=utf-8',
|
|
||||||
'.js': 'application/javascript; charset=utf-8',
|
|
||||||
'.css': 'text/css; charset=utf-8',
|
|
||||||
'.json': 'application/json',
|
|
||||||
'.png': 'image/png',
|
|
||||||
'.jpg': 'image/jpeg',
|
|
||||||
'.svg': 'image/svg+xml',
|
|
||||||
'.woff2': 'font/woff2'
|
|
||||||
};
|
|
||||||
res.writeHead(200, { 'Content-Type': mimeTypes[ext] || 'application/octet-stream' });
|
|
||||||
res.end(data);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
|
||||||
server.listen(0, '127.0.0.1', () => {
|
|
||||||
resolve({ server, port: server.address().port });
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function testOsNegotiation() {
|
module.exports = Object.freeze({ LEGACY_MOBILE_RELEASE_PIPELINE_DISABLED });
|
||||||
const distDir = path.resolve('site/dist');
|
|
||||||
const { server, port } = await serveStatic(distDir);
|
|
||||||
const url = `http://127.0.0.1:${port}`;
|
|
||||||
console.log(`Static server running on ${url}`);
|
|
||||||
|
|
||||||
const browser = await chromium.launch({ channel: 'chrome', headless: true });
|
|
||||||
const outDir = 'C:/Users/encep/.gemini/antigravity-cli/brain/3ab7ae82-5634-41d5-93a7-3c12c22503e2/screenshots/live_production_verified';
|
|
||||||
if (!fs.existsSync(outDir)) fs.mkdirSync(outDir, { recursive: true });
|
|
||||||
|
|
||||||
// 1. Android Mobile Emulation (Pixel 7)
|
|
||||||
console.log('--- Testing Android Device Emulation (Pixel 7) ---');
|
|
||||||
const androidContext = await browser.newContext({
|
|
||||||
...devices['Pixel 7'],
|
|
||||||
locale: 'ko-KR'
|
|
||||||
});
|
|
||||||
const pageAndroid = await androidContext.newPage();
|
|
||||||
await pageAndroid.goto(url, { waitUntil: 'networkidle' });
|
|
||||||
await pageAndroid.waitForTimeout(1000);
|
|
||||||
|
|
||||||
const androidBtn = await pageAndroid.evaluate(() => {
|
|
||||||
const el = document.querySelector('a.glow-btn');
|
|
||||||
return el ? { text: el.innerText.trim(), href: el.href, download: el.getAttribute('download') } : null;
|
|
||||||
});
|
|
||||||
console.log('Android CTA Button:', androidBtn);
|
|
||||||
await pageAndroid.screenshot({ path: path.join(outDir, '19_hero_android_os_negotiated.png') });
|
|
||||||
|
|
||||||
// 2. iOS Mobile Emulation (iPhone 14)
|
|
||||||
console.log('--- Testing iPhone Device Emulation (iPhone 14) ---');
|
|
||||||
const iosContext = await browser.newContext({
|
|
||||||
...devices['iPhone 14'],
|
|
||||||
locale: 'ko-KR'
|
|
||||||
});
|
|
||||||
const pageIos = await iosContext.newPage();
|
|
||||||
await pageIos.goto(url, { waitUntil: 'networkidle' });
|
|
||||||
await pageIos.waitForTimeout(1000);
|
|
||||||
|
|
||||||
const iosBtn = await pageIos.evaluate(() => {
|
|
||||||
const el = document.querySelector('a.glow-btn');
|
|
||||||
return el ? { text: el.innerText.trim(), href: el.href } : null;
|
|
||||||
});
|
|
||||||
console.log('iOS CTA Button:', iosBtn);
|
|
||||||
await pageIos.screenshot({ path: path.join(outDir, '20_hero_ios_os_negotiated.png') });
|
|
||||||
|
|
||||||
// 3. Windows Desktop
|
|
||||||
console.log('--- Testing Windows Desktop Emulation ---');
|
|
||||||
const winContext = await browser.newContext({
|
|
||||||
viewport: { width: 1440, height: 900 },
|
|
||||||
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
|
|
||||||
locale: 'ko-KR'
|
|
||||||
});
|
|
||||||
const pageWin = await winContext.newPage();
|
|
||||||
await pageWin.goto(url, { waitUntil: 'networkidle' });
|
|
||||||
await pageWin.waitForTimeout(1000);
|
|
||||||
|
|
||||||
const winBtn = await pageWin.evaluate(() => {
|
|
||||||
const el = document.querySelector('a.glow-btn');
|
|
||||||
return el ? { text: el.innerText.trim(), href: el.href, download: el.getAttribute('download') } : null;
|
|
||||||
});
|
|
||||||
console.log('Windows CTA Button:', winBtn);
|
|
||||||
await pageWin.screenshot({ path: path.join(outDir, '21_hero_windows_os_negotiated.png') });
|
|
||||||
|
|
||||||
await browser.close();
|
|
||||||
server.close();
|
|
||||||
console.log('=== ALL REAL OS NEGOTIATION TESTS PASSED ===');
|
|
||||||
}
|
|
||||||
|
|
||||||
testOsNegotiation().catch(console.error);
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue