Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/tests/frontend-new/helper/padHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
await page.keyboard.type(message)
await page.keyboard.press('Enter')
if(message === "") return
await page.waitForFunction(`document.querySelector('#chattext').querySelectorAll('p').length >${currentChatCount}`)

Check failure on line 73 in src/tests/frontend-new/helper/padHelper.ts

View workflow job for this annotation

GitHub Actions / Playwright Firefox with plugins

[firefox] › tests/frontend-new/specs/change_user_color.spec.ts:59:7 › change user color › Own user color is shown when you enter a chat

3) [firefox] › tests/frontend-new/specs/change_user_color.spec.ts:59:7 › change user color › Own user color is shown when you enter a chat Error: page.waitForFunction: Test timeout of 90000ms exceeded. at tests/frontend-new/helper/padHelper.ts:73 71 | await page.keyboard.press('Enter') 72 | if(message === "") return > 73 | await page.waitForFunction(`document.querySelector('#chattext').querySelectorAll('p').length >${currentChatCount}`) | ^ 74 | } 75 | 76 | export const isChatBoxShown = async (page: Page):Promise<boolean> => { at sendChatMessage (/home/runner/work/etherpad/etherpad/src/tests/frontend-new/helper/padHelper.ts:73:14) at /home/runner/work/etherpad/etherpad/src/tests/frontend-new/specs/change_user_color.spec.ts:89:5
}

export const isChatBoxShown = async (page: Page):Promise<boolean> => {
Expand Down Expand Up @@ -118,7 +118,7 @@
// create a new pad before each test run
const padId = "FRONTEND_TESTS"+randomUUID();
await page.goto('http://localhost:9001/p/'+padId);
await page.waitForSelector('iframe[name="ace_outer"]');

Check failure on line 121 in src/tests/frontend-new/helper/padHelper.ts

View workflow job for this annotation

GitHub Actions / Playwright Firefox with plugins

[firefox] › tests/frontend-new/specs/change_user_color.spec.ts:10:7 › change user color › Color picker matches original color and remembers the user color after a refresh

2) [firefox] › tests/frontend-new/specs/change_user_color.spec.ts:10:7 › change user color › Color picker matches original color and remembers the user color after a refresh Error: page.waitForSelector: Test timeout of 90000ms exceeded. Call log: - waiting for locator('iframe[name="ace_outer"]') to be visible at tests/frontend-new/helper/padHelper.ts:121 119 | const padId = "FRONTEND_TESTS"+randomUUID(); 120 | await page.goto('http://localhost:9001/p/'+padId); > 121 | await page.waitForSelector('iframe[name="ace_outer"]'); | ^ 122 | await page.waitForSelector('#editorcontainer.initialized'); 123 | return padId; 124 | } at goToNewPad (/home/runner/work/etherpad/etherpad/src/tests/frontend-new/helper/padHelper.ts:121:14) at /home/runner/work/etherpad/etherpad/src/tests/frontend-new/specs/change_user_color.spec.ts:46:7
await page.waitForSelector('#editorcontainer.initialized');
return padId;
}
Expand All @@ -142,7 +142,18 @@
export const writeToPad = async (page: Page, text: string) => {
const body = await getPadBody(page);
await body.click();
await page.keyboard.type(text);
// Use insertText (single input event) instead of keyboard.type
// (one keydown/keyup per char). Firefox under WITH_PLUGINS load
// racily drops characters from per-key events; insertText delivers
// each chunk in one event, which Etherpad's incorporateUserChanges
// pipeline handles atomically. insertText does not translate \n
// into a real Enter keystroke, so split on newlines and press
// Enter between segments to preserve multi-line input.
const lines = text.split('\n');
for (let i = 0; i < lines.length; i++) {
if (lines[i]) await page.keyboard.insertText(lines[i]);
if (i < lines.length - 1) await page.keyboard.press('Enter');
}
Comment on lines +145 to +156
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. No regression test for writetopad() 📘 Rule violation ☼ Reliability

This PR changes writeToPad() behavior to fix Firefox keystroke drops, but it does not add any
regression test that would fail if page.keyboard.type() were reintroduced. Without a dedicated
test, this failure mode can silently return and only be caught as flaky CI failures.
Agent Prompt
## Issue description
`writeToPad()` was modified to fix a Firefox keystroke-drop bug, but there is no new regression test that would fail if the fix were reverted.

## Issue Context
The fix relies on `page.keyboard.insertText()` and newline splitting/Enter presses. A regression test should exercise `writeToPad()` with a string that includes multiple lines and enough characters to have previously triggered the Firefox drop issue in the affected CI configuration.

## Fix Focus Areas
- src/tests/frontend-new/helper/padHelper.ts[145-156]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

}

export const clearAuthorship = async (page: Page) => {
Expand Down
Loading