Skip to content

Commit

Permalink
Smoke tests: data explorer fixes (#5179)
Browse files Browse the repository at this point in the history
Break data explorer tests into separate app instances and add variables
selection workaround for web.

### QA Notes

All smoke tests should pass.
  • Loading branch information
testlabauto authored Oct 28, 2024
1 parent d85e8d8 commit a0bda65
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
7 changes: 7 additions & 0 deletions test/automation/src/positron/positronVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,11 @@ export class PositronVariables {

return result;
}

async selectVariablesGroup(name: string) {
await this.code.driver.page.locator('.positron-variables-container .action-bar-button-text').click();
await this.code.driver.page.locator('a.action-menu-item', { hasText: name }).isVisible();
await this.code.wait(500);
await this.code.driver.page.locator('a.action-menu-item', { hasText: name }).click();
}
}
24 changes: 21 additions & 3 deletions test/smoke/src/areas/positron/dataexplorer/dataexplorer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,17 @@ df2 = pd.DataFrame(data)`;
await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar');
await app.workbench.positronConsole.waitForConsoleContents((contents) => contents.some((line) => line.includes('restarted')));

await app.workbench.positronNotebooks.openNotebook(join(app.workspacePathOrFolder, 'workspaces', 'data-explorer-update-datasets', 'pandas-update-dataframe.ipynb'));
const filename = 'pandas-update-dataframe.ipynb';
await app.workbench.positronNotebooks.openNotebook(join(app.workspacePathOrFolder, 'workspaces', 'data-explorer-update-datasets', filename));
await app.workbench.notebook.focusFirstCell();
await app.workbench.notebook.executeActiveCell();

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

await expect(async () => {
await app.workbench.positronVariables.doubleClickVariableRow('df');
await app.code.driver.getLocator('.label-name:has-text("Data: df")').innerText();
Expand Down Expand Up @@ -204,8 +212,12 @@ df2 = pd.DataFrame(data)`;
});
});

// There is a known issue with the data explorer tests causing them to intermittently fail:
// https://github.com/posit-dev/positron/issues/4663
});


describe('Data Explorer #web #win', () => {
logger = setupAndStartApp();

describe('Python Polars Data Explorer #pr', () => {
before(async function () {
await PositronPythonFixtures.SetupFixtures(this.app as Application);
Expand Down Expand Up @@ -347,6 +359,12 @@ df2 = pd.DataFrame(data)`;
});
});

});


describe('Data Explorer #web #win', () => {
logger = setupAndStartApp();

describe('R Data Explorer', () => {

before(async function () {
Expand Down

0 comments on commit a0bda65

Please sign in to comment.