Iterating on arrows

This commit is contained in:
Mark Tolmacs
2025-08-26 14:55:40 +02:00
parent b8aae34e32
commit 5ba2798306
9 changed files with 660 additions and 3224 deletions

View File

@@ -16,12 +16,10 @@ export class Record {
} }
private static header() { private static header() {
Record.events += ` await page.setViewportSize({ width: ${window.innerWidth}, height: ${window.innerHeight} });\n`; Record.events += " await page.addInitScript(() => {\n";
Record.events += ` await page.goto("http://localhost:3000");\n`; Record.events += " Math.random = () => 0.42;\n\n";
Record.events += ` await page.waitForLoadState("load");\n`;
// Capture LocalStorage, which is essential to re-establish state // Capture LocalStorage, which is essential to re-establish state
Record.events += " await page.evaluate(() => {\n";
for (let i = 0; i < localStorage.length; i++) { for (let i = 0; i < localStorage.length; i++) {
const key = localStorage.key(i); const key = localStorage.key(i);
if (key != null) { if (key != null) {
@@ -31,7 +29,8 @@ export class Record {
} }
} }
Record.events += " });\n"; Record.events += " });\n";
Record.events += " await page.reload();\n"; Record.events += ` await page.setViewportSize({ width: ${window.innerWidth}, height: ${window.innerHeight} });\n`;
Record.events += ` await page.goto("http://localhost:3000");\n`;
Record.events += ` await page.waitForLoadState("load");\n`; Record.events += ` await page.waitForLoadState("load");\n`;
} }

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB