Debian Codegraph @

Platforms/emscripten/browser_test/index.spec.ts

raw
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