Skip to content

Commit

Permalink
e2e-test: console python test, add an extra enter key (#6171)
Browse files Browse the repository at this point in the history
### Summary
The console displays a + prompt instead of executing the command,
indicating it is expecting more input because the previous command was
incomplete. We don't know why this is happening, but maybe sending
another Enter key will kick it in gear.

### QA Notes

@:console
  • Loading branch information
midleman authored Jan 31, 2025
1 parent 5177ff7 commit ec85373
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion test/e2e/pages/console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,13 @@ export class Console {
await this.code.driver.page.locator(MAXIMIZE_CONSOLE).click();
}

async pasteCodeToConsole(code: string) {
async pasteCodeToConsole(code: string, sendEnterKey = false) {
const consoleInput = this.activeConsole.locator(CONSOLE_INPUT);
await this.pasteInMonaco(consoleInput!, code);

if (sendEnterKey) {
await this.sendEnterKey();
}
}

async pasteInMonaco(
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/tests/console/console-python.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ test.describe('Console Pane: Python', { tag: [tags.WEB, tags.CONSOLE] }, () => {

await app.workbench.console.barClearButton.click();

await app.workbench.console.pasteCodeToConsole('import platform; print(platform.python_version())');
await app.workbench.console.pasteCodeToConsole('import platform; print(platform.python_version())', true);
await app.workbench.console.sendEnterKey();

await app.workbench.console.waitForConsoleContents(primaryPython);
Expand All @@ -84,7 +84,7 @@ test.describe('Console Pane: Python', { tag: [tags.WEB, tags.CONSOLE] }, () => {

await app.workbench.console.barClearButton.click();

await app.workbench.console.pasteCodeToConsole(`import platform; print(platform.python_version())`);
await app.workbench.console.pasteCodeToConsole(`import platform; print(platform.python_version())`, true);
await app.workbench.console.sendEnterKey();
await app.workbench.console.waitForConsoleContents(secondaryPython);
} else {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/tests/console/console-r.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ test.describe('Console Pane: R', {

await app.workbench.console.barClearButton.click();

await app.workbench.console.pasteCodeToConsole('R.version.string');
await app.workbench.console.pasteCodeToConsole('R.version.string', true);
await app.workbench.console.sendEnterKey();

await app.workbench.console.waitForConsoleContents(primaryR);
Expand All @@ -80,7 +80,7 @@ test.describe('Console Pane: R', {

await app.workbench.console.barClearButton.click();

await app.workbench.console.pasteCodeToConsole(`R.version.string`);
await app.workbench.console.pasteCodeToConsole(`R.version.string`, true);
await app.workbench.console.sendEnterKey();
await app.workbench.console.waitForConsoleContents(secondaryR);
} else {
Expand Down

0 comments on commit ec85373

Please sign in to comment.