Skip to content

Commit

Permalink
Adds e2e test for Console code wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
samclark2015 committed Jan 22, 2025
1 parent fdb264a commit 57df982
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/e2e/tests/console/console-output.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the Elastic License 2.0. See LICENSE.txt for license information.
*--------------------------------------------------------------------------------------------*/

import { test, tags } from '../_test.setup';
import { test, tags, expect } from '../_test.setup';

test.use({
suiteId: __filename
Expand All @@ -16,6 +16,16 @@ test.describe('Console Output', { tag: [tags.WIN, tags.CONSOLE, tags.WEB] }, ()
await app.workbench.console.waitForConsoleContents('Why do programmers prefer dark mode');
await app.workbench.console.waitForConsoleContents('Because light attracts bugs!');
});

test('Long console output wraps appropriately', async function ({ app, page, python }) {
await app.workbench.console.waitForReady('>>>');
await app.workbench.console.pasteCodeToConsole(pyCode);
await app.workbench.console.sendEnterKey();
await app.workbench.console.waitForReady('>>>');

const el = page.locator('.console-instance');
await expect(await el.evaluate((el) => el.scrollWidth)).toBeLessThanOrEqual(await el.evaluate((el) => el.clientWidth));
});
});

const rCode = `tokens <- c(
Expand All @@ -38,3 +48,5 @@ const rCode = `tokens <- c(
cat(token)
Sys.sleep(0.01)
}`;

const pyCode = `"Blah" * 300`;

0 comments on commit 57df982

Please sign in to comment.