Skip to content

Commit a1fe016

Browse files
committed
gh-124621: Emscripten: Add smoke test for using pyrepl in Chrome
This should make it less likely that we break Python startup in the browser.
1 parent c933a6b commit a1fe016

File tree

6 files changed

+732
-0
lines changed

6 files changed

+732
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
test-results
3+
playwright-report
4+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test('has title', async ({ page }) => {
4+
await page.goto('/');
5+
6+
await expect(page).toHaveTitle("Emscripten PyRepl Example");
7+
const xterm = await page.locator('css=#terminal');
8+
await expect(xterm).toHaveText(/Python.*on emscripten.*Type.*for more information/);
9+
const xtermInput = await page.getByRole('textbox');
10+
await xtermInput.pressSequentially(`def f():\nprint("hello", "emscripten repl!")\n\n`);
11+
await xtermInput.pressSequentially(`f()\n`);
12+
await expect(xterm).toHaveText(/hello emscripten repl!/);
13+
14+
});
15+

0 commit comments

Comments
 (0)