Skip to content

Commit

Permalink
Smoke tests: fixes for notebook vars tests (#5196)
Browse files Browse the repository at this point in the history
Fix issues with notebook vars test. Assuming that we are changing
interpreters too quickly

### QA Notes

All smoke tests pass
  • Loading branch information
testlabauto authored Oct 29, 2024
1 parent d923ee5 commit c6a9d79
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions test/smoke/src/areas/positron/variables/variables-notebook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import { setupAndStartApp } from '../../../test-runner/test-hooks';

describe('Variables Pane - Notebook', () => {

// This test fails on WEB: https://github.com/posit-dev/positron/issues/2452
describe('Python Notebook Variables Pane #pr', () => {
describe('Python Notebook Variables Pane #pr #web', () => {
setupAndStartApp();

before(async function () {
Expand All @@ -19,16 +18,27 @@ describe('Variables Pane - Notebook', () => {

it('Verifies Variables pane basic function for notebook with python interpreter [C669188]', async function () {
const app = this.app as Application;
await PositronPythonFixtures.SetupFixtures(this.app as Application);

await app.workbench.positronNotebooks.createNewNotebook();

// workaround issue where starting multiple interpreters in quick succession can cause startup failure
await app.code.wait(1000);

await app.workbench.positronNotebooks.selectInterpreter('Python Environments', process.env.POSITRON_PY_VER_SEL!);
await app.workbench.positronNotebooks.addCodeToFirstCell('y = [2, 3, 4, 5]');
await app.workbench.positronNotebooks.executeCodeInCell();

const filename = 'Untitled-1.ipynb';

// temporary workaround for fact that variables group
// not properly autoselected on web
if (app.web) {
await app.workbench.positronVariables.selectVariablesGroup(filename);
}

const interpreter = app.workbench.positronVariables.interpreterLocator;
await expect(interpreter).toBeVisible();
await expect(interpreter).toHaveText('Untitled-1.ipynb');
await expect(interpreter).toHaveText(filename);

await app.workbench.positronLayouts.enterLayout('fullSizedAuxBar');
const variablesMap = await app.workbench.positronVariables.getFlatVariables();
Expand All @@ -45,9 +55,12 @@ describe('Variables Pane - Notebook', () => {

it('Verifies Variables pane basic function for notebook with R interpreter [C669189]', async function () {
const app = this.app as Application;
await PositronRFixtures.SetupFixtures(this.app as Application);

await app.workbench.positronNotebooks.createNewNotebook();

// workaround issue where starting multiple interpreters in quick succession can cause startup failure
await app.code.wait(1000);

await app.workbench.positronNotebooks.selectInterpreter('R Environments', process.env.POSITRON_R_VER_SEL!);
await app.workbench.positronNotebooks.addCodeToFirstCell('y <- c(2, 3, 4, 5)');
await app.workbench.positronNotebooks.executeCodeInCell();
Expand Down

0 comments on commit c6a9d79

Please sign in to comment.