Skip to content

Commit 134a907

Browse files
authored
E2E test: unskip reticulate tests (#7493)
Reticulate tests were temporarily skipped when the session renaming functionality was merged. This gets them back into the suite. ### QA Notes @:web @:reticulate
1 parent 81d4778 commit 134a907

File tree

5 files changed

+30
-38
lines changed

5 files changed

+30
-38
lines changed

test/e2e/pages/popups.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export class Popups {
7575
// TODO: make this smart later, perhaps by getting the console state from the API
7676
await this.code.wait(5000);
7777
} catch {
78-
this.code.logger.log('Did not find modal dialog box');
78+
this.code.logger.log('Did not find modal dialog box for ipykernel install');
7979
}
8080
}
8181

test/e2e/pages/sessions.ts

+16
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,22 @@ export class Sessions {
674674
return 'unknown';
675675
}
676676

677+
/**
678+
* Helper: Rename a session
679+
*
680+
* @param oldName - Name of the session to rename (or part of the name)
681+
* @param newName - New session name
682+
*/
683+
async renameSession(oldName: string, newName: string) {
684+
await this.quickaccess.runCommand('workbench.action.language.runtime.renameSession', { keepOpen: true });
685+
await this.quickinput.waitForQuickInputOpened();
686+
await this.quickinput.type(oldName);
687+
await this.quickinput.waitForQuickInputElements(e => e.length === 1 && e[0].includes(oldName));
688+
await this.quickinput.quickInputList.getByText(oldName).first().click();
689+
await this.quickinput.type(newName);
690+
await this.code.driver.page.keyboard.press('Enter');
691+
}
692+
677693
/**
678694
* Action: Open the metadata dialog for the current session
679695
*/

test/e2e/tests/reticulate/reticulate-multiple.test.ts

+8-24
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test.use({
1414
// RETICULATE_PYTHON
1515
// to the installed python path
1616

17-
test.describe.skip('Reticulate', {
17+
test.describe('Reticulate', {
1818
tag: [tags.RETICULATE, tags.WEB],
1919
}, () => {
2020
test.beforeAll(async function ({ app, workspaceSettings }) {
@@ -29,43 +29,27 @@ test.describe.skip('Reticulate', {
2929
}
3030
});
3131

32-
test('R - Verify Basic Reticulate Functionality using reticulate::repl_python() with multiple sessions', async function ({ app, sessions }) {
32+
test('R - Verify Basic Reticulate Functionality using reticulate::repl_python() with multiple sessions', async function ({ app, sessions, logger }) {
3333

3434
const rSessionMetaData = await sessions.start('r');
3535

3636
await app.workbench.console.pasteCodeToConsole('reticulate::repl_python()', true);
3737

38-
try {
39-
await app.workbench.console.waitForConsoleContents('Yes/no/cancel');
40-
await app.workbench.console.typeToConsole('no');
41-
await app.workbench.console.sendEnterKey();
42-
} catch {
43-
// Prompt did not appear
44-
}
45-
46-
await app.workbench.popups.installIPyKernel();
47-
4838
await app.workbench.console.waitForReadyAndStarted('>>>');
4939

50-
await verifyReticulateFunctionality(app, rSessionMetaData.id);
40+
await app.workbench.sessions.renameSession('reticulate', 'sessionOne');
41+
42+
await verifyReticulateFunctionality(app, rSessionMetaData.id, 'sessionOne');
5143

5244
const rSessionMetaData2 = await sessions.start('r', { reuse: false });
5345

5446
await app.workbench.console.pasteCodeToConsole('reticulate::repl_python()', true);
5547

56-
try {
57-
await app.workbench.console.waitForConsoleContents('Yes/no/cancel');
58-
await app.workbench.console.typeToConsole('no');
59-
await app.workbench.console.sendEnterKey();
60-
} catch {
61-
// Prompt did not appear
62-
}
63-
64-
await app.workbench.popups.installIPyKernel();
65-
6648
await app.workbench.console.waitForReadyAndStarted('>>>');
6749

68-
await verifyReticulateFunctionality(app, rSessionMetaData2.id, 'Python (reticulate)', '300', '500', '7');
50+
await app.workbench.sessions.renameSession('reticulate', 'sessionTwo');
51+
52+
await verifyReticulateFunctionality(app, rSessionMetaData2.id, 'sessionTwo', '300', '500', '7');
6953

7054
});
7155
});

test/e2e/tests/reticulate/reticulate-repl-python.test.ts

+1-11
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,12 @@ test.describe('Reticulate', {
2929
}
3030
});
3131

32-
test('R - Verify Basic Reticulate Functionality using reticulate::repl_python()', async function ({ app, sessions }) {
32+
test('R - Verify Basic Reticulate Functionality using reticulate::repl_python()', async function ({ app, sessions, logger }) {
3333

3434
const rSessionMetaData = await sessions.start('r');
3535

3636
await app.workbench.console.pasteCodeToConsole('reticulate::repl_python()', true);
3737

38-
try {
39-
await app.workbench.console.waitForConsoleContents('Yes/no/cancel');
40-
await app.workbench.console.typeToConsole('no');
41-
await app.workbench.console.sendEnterKey();
42-
} catch {
43-
// Prompt did not appear
44-
}
45-
46-
await app.workbench.popups.installIPyKernel();
47-
4838
await app.workbench.console.waitForReadyAndStarted('>>>');
4939

5040
await verifyReticulateFunctionality(app, rSessionMetaData.id);

test/e2e/tests/reticulate/reticulate-stop-start.test.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test.use({
1414
// RETICULATE_PYTHON
1515
// to the installed python path
1616

17-
test.describe.skip('Reticulate', {
17+
test.describe('Reticulate', {
1818
tag: [tags.RETICULATE, tags.WEB],
1919
}, () => {
2020
test.beforeAll(async function ({ app, workspaceSettings }) {
@@ -49,7 +49,9 @@ test.describe.skip('Reticulate', {
4949

5050
await app.workbench.console.waitForReadyAndStarted('>>>', 30000);
5151

52-
await verifyReticulateFunctionality(app, `R ${process.env.POSITRON_R_VER_SEL!}`, 'Python (reticulate)');
52+
await app.workbench.sessions.renameSession('reticulate', 'reticulateNew');
53+
54+
await verifyReticulateFunctionality(app, `R ${process.env.POSITRON_R_VER_SEL!}`, 'reticulateNew');
5355

5456
});
5557

0 commit comments

Comments
 (0)