feat: simplify receiving and remove arbitrary limits
- Use fixed port 8787 and reconnect automatically after Wi-Fi loss - Remove session expiry, APK expiry, size caps, and upload deadlines - Replace manual keys with watch-approved browser access - Improve streaming, storage recovery, and resource cleanup - Preserve explicit Android installation consent - Document retained safeguards and expand emulator coverage
This commit is contained in:
41 files changed
+1241
-561
No files matched your search
+25
-10
@@ -19,6 +19,8 @@ const path = require('node:path');
|
||||
page.on('pageerror', (error) => errors.push(error.message));
|
||||
await page.goto(session.href, { timeout: 20000 });
|
||||
await page.getByText('Connected to your watch', { exact: true }).waitFor({ timeout: 20000 });
|
||||
assert.equal(session.port, '8787');
|
||||
assert.equal(session.hash, '');
|
||||
assert.equal(
|
||||
await page.evaluate(() => document.documentElement.scrollWidth > innerWidth),
|
||||
false,
|
||||
@@ -27,25 +29,37 @@ const path = require('node:path');
|
||||
path: path.join(reports, 'android-browser.png'),
|
||||
fullPage: true,
|
||||
});
|
||||
await page.locator('#file').setInputFiles({
|
||||
name: 'pakkit-test.apk',
|
||||
mimeType: 'application/vnd.android.package-archive',
|
||||
buffer: fs.readFileSync(
|
||||
path.resolve(__dirname, '../qa/fixture/build/outputs/apk/debug/qaFixture-debug.apk'),
|
||||
),
|
||||
});
|
||||
const fixture =
|
||||
process.env.PAKKIT_TEST_APK ||
|
||||
path.resolve(__dirname, '../qa/fixture/build/outputs/apk/debug/qaFixture-debug.apk');
|
||||
if (process.env.PAKKIT_BROWSER_FILE) {
|
||||
const cdp = await context.newCDPSession(page);
|
||||
const { root } = await cdp.send('DOM.getDocument');
|
||||
const { nodeId } = await cdp.send('DOM.querySelector', {
|
||||
nodeId: root.nodeId,
|
||||
selector: '#file',
|
||||
});
|
||||
await cdp.send('DOM.setFileInputFiles', { nodeId, files: [process.env.PAKKIT_BROWSER_FILE] });
|
||||
await cdp.detach();
|
||||
} else {
|
||||
await page.locator('#file').setInputFiles({
|
||||
name: 'pakkit-test.apk',
|
||||
mimeType: 'application/vnd.android.package-archive',
|
||||
buffer: fs.readFileSync(fixture),
|
||||
});
|
||||
}
|
||||
await page.getByRole('button', { name: 'Send to watch' }).click();
|
||||
await page.getByRole('heading', { name: 'Made it to your watch' }).waitFor({ timeout: 30000 });
|
||||
await page.screenshot({
|
||||
path: path.join(reports, 'android-browser-review.png'),
|
||||
fullPage: true,
|
||||
});
|
||||
const status = await page.evaluate(async (token) => {
|
||||
const status = await page.evaluate(async () => {
|
||||
const response = await fetch('/api/status', {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
headers: { Authorization: 'Bearer ' + localStorage.getItem('pakkitAccess') },
|
||||
});
|
||||
return response.json();
|
||||
}, session.hash.slice(1));
|
||||
});
|
||||
assert.equal(status.state, 'ready');
|
||||
assert.equal(status.label, 'Pakkit QA fixture');
|
||||
assert.deepEqual(errors, []);
|
||||
@@ -54,6 +68,7 @@ const path = require('node:path');
|
||||
directEmulatorWifi: true,
|
||||
upload: 'ready',
|
||||
javascriptErrors: errors,
|
||||
uploadedBytes: fs.statSync(fixture).size,
|
||||
};
|
||||
fs.writeFileSync(
|
||||
path.join(reports, 'android-browser.json'),
|
||||
|
||||
Reference in new issue
Block a user