Skip to content

Commit b07eeae

Browse files
committed
Langtour: fix E2E test code replacement for CI
1 parent 7a7f1ed commit b07eeae

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

language-tour/src/utils/hooks/usePopcornEval.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function usePopcornEval() {
1212
const stopLogCapture = startLogCapture();
1313

1414
const result = await call(["eval_elixir", editorId, code, editorOrder], {
15-
timeoutMs: 45_000
15+
timeoutMs: 120_000
1616
});
1717
const { stderr, stdout } = stopLogCapture();
1818

language-tour/tests/language-tour.spec.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,8 @@ test.describe("Language Tour - All Topics", () => {
2929
const cmContent = cell.locator(".cm-content");
3030

3131
await cmContent.click();
32-
await page.keyboard.press("Meta+A");
33-
await cmContent.evaluate((el, code) => {
34-
const dt = new DataTransfer();
35-
dt.setData("text/plain", code!);
36-
el.dispatchEvent(
37-
new ClipboardEvent("paste", {
38-
clipboardData: dt,
39-
bubbles: true,
40-
cancelable: true
41-
})
42-
);
43-
}, testReplaceCode);
32+
await page.keyboard.press("ControlOrMeta+A");
33+
await page.keyboard.insertText(testReplaceCode!);
4434
}
4535

4636
const runButtons = page.locator("button").filter({ hasText: "Run Code" });
@@ -62,7 +52,7 @@ test.describe("Language Tour - All Topics", () => {
6252
const count = await badges.count();
6353
for (let i = 0; i < count; i++) {
6454
await expect(badges.nth(i)).toHaveAttribute("data-state", "success", {
65-
timeout: 90_000
55+
timeout: 120_000
6656
});
6757
}
6858

0 commit comments

Comments
 (0)