Skip to content

Commit 64eb540

Browse files
miss-islingtonhoodmanezware
authored
[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>
1 parent 40632ad commit 64eb540

File tree

8 files changed

+753
-0
lines changed

8 files changed

+753
-0
lines changed

Tools/wasm/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,17 @@ make a node application that "embeds" the interpreter instead of acting like the
8484
CLI you will need to write your own alternative to `node_entry.mjs`.
8585

8686

87+
### Running tests
88+
89+
After building, you can run the full test suite with:
90+
```shell
91+
./cross-build/wasm32-emscripten/build/python/python.sh -m test -uall
92+
```
93+
You can run the browser smoke test with:
94+
```shell
95+
./Tools/wasm/emscripten/browser_test/run_test.sh
96+
```
97+
8798
### The Web Example
8899

89100
When building for Emscripten, the web example will be built automatically. It
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+
test_log.txt
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy