mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.14] gh-124621: Emscripten: Add smoke test for using pyrepl in Chrome (GH-137004) (#137067)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com> Co-authored-by: Zachary Ware <zach@python.org>
This commit is contained in:
parent
40632ad7ba
commit
64eb54062d
8 changed files with 753 additions and 0 deletions
15
Tools/wasm/emscripten/browser_test/index.spec.ts
Normal file
15
Tools/wasm/emscripten/browser_test/index.spec.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('has title', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
|
||||
await expect(page).toHaveTitle("Emscripten PyRepl Example");
|
||||
const xterm = await page.locator('css=#terminal');
|
||||
await expect(xterm).toHaveText(/Python.*on emscripten.*Type.*for more information/);
|
||||
const xtermInput = await page.getByRole('textbox');
|
||||
await xtermInput.pressSequentially(`def f():\nprint("hello", "emscripten repl!")\n\n`);
|
||||
await xtermInput.pressSequentially(`f()\n`);
|
||||
await expect(xterm).toHaveText(/hello emscripten repl!/);
|
||||
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue