Skip to content

Commit aceee94

Browse files
committed
Fix topics e2e tests
1 parent d1472dd commit aceee94

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

frontend/tests/console/topics/topic-messages-filtering.spec.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -221,16 +221,16 @@ test.describe('View and Filter Messages', () => {
221221
await test.step('Apply filter and check URL', async () => {
222222
await page.goto(`/topics/${topicName}`);
223223

224-
const searchInput = page.getByPlaceholder(/search|filter/i);
225-
if (await searchInput.isVisible()) {
226-
await searchInput.fill('test-search');
227-
await page.keyboard.press('Enter');
228-
await page.waitForTimeout(500);
229-
230-
// URL should contain filter parameters (quick search uses 'q' param)
231-
const currentUrl = page.url();
232-
expect(currentUrl).toContain('q=test-search');
233-
}
224+
// Use the specific testId for message quick search
225+
const searchInput = page.getByTestId('message-quick-search-input');
226+
await expect(searchInput).toBeVisible({ timeout: 5000 });
227+
await searchInput.fill('test-search');
228+
await page.keyboard.press('Enter');
229+
await page.waitForTimeout(500);
230+
231+
// URL should contain filter parameters (quick search uses 'q' param)
232+
const currentUrl = page.url();
233+
expect(currentUrl).toContain('q=test-search');
234234
});
235235

236236
await test.step('Reload page and verify filter persists', async () => {

frontend/tests/console/topics/topic-messages-production.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ test.describe('Produce Messages', () => {
7171

7272
const valueEditor = page.getByTestId('produce-value-editor').locator('.monaco-editor').first();
7373
await valueEditor.click();
74+
75+
// Clear any existing content before inserting new text
76+
await page.keyboard.press('Meta+A'); // Select all (Mac)
77+
await page.keyboard.press('Control+A'); // Select all (Windows/Linux)
78+
await page.keyboard.press('Backspace');
79+
7480
await page.keyboard.insertText(message);
7581
await page.getByTestId('produce-button').click();
7682

0 commit comments

Comments
 (0)