Skip to content

Commit

Permalink
E2E test: fix F1 test issues (#6096)
Browse files Browse the repository at this point in the history
Fix F1 issue where the variables pane was not visible because it was
obscured by Help.

Also removed some old Windows workarounds from when windows runner
screen was very small.

### QA Notes

All Help tests should pass.

@:help @:web @:win
  • Loading branch information
testlabauto authored Jan 23, 2025
1 parent f771d2c commit 2fb274a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 24 deletions.
4 changes: 4 additions & 0 deletions test/e2e/pages/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,8 @@ export class Variables {
const DATABASE_ICON = '.codicon-database';
await this.code.driver.page.locator(VARIABLE_ITEMS).filter({ hasText: rowName }).locator(DATABASE_ICON).click();
}

async clickSessionLink() {
await this.code.driver.page.getByLabel('Active View Switcher').getByText('Session').click();
}
}
28 changes: 4 additions & 24 deletions test/e2e/tests/help/f1.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ test.describe('F1 Help', {
await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'nyc-flights-data-r', 'flights-data-frame.r'));
await app.workbench.quickaccess.runCommand('r.sourceCurrentFile');

await app.workbench.variables.clickSessionLink();
await app.workbench.variables.waitForVariableRow('df2');

await app.workbench.console.pasteCodeToConsole('colnames(df2)');
Expand All @@ -42,14 +43,8 @@ test.describe('F1 Help', {
test('R - Verifies basic F1 editor help functionality [C1062994]', async function ({ app, page, r }) {
await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'generate-data-frames-r', 'generate-data-frames.r'));

await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar');
await app.workbench.quickaccess.runCommand('workbench.action.toggleSidebarVisibility');
await app.workbench.quickaccess.runCommand('workbench.action.togglePanel');
await app.code.driver.page.locator('span').filter({ hasText: 'colnames(df) <- paste0(\'col\', 1:num_cols)' }).locator('span').first().dblclick();
await page.keyboard.press('F1');
await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar');
await app.workbench.quickaccess.runCommand('workbench.action.toggleSidebarVisibility');
await app.workbench.quickaccess.runCommand('workbench.action.togglePanel');

await expect(async () => {
const helpFrame = await app.workbench.help.getHelpFrame(0);
Expand Down Expand Up @@ -81,6 +76,7 @@ test.describe('F1 Help', {
await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'nyc-flights-data-py', 'flights-data-frame.py'));
await app.workbench.quickaccess.runCommand('python.execInConsole');

await app.workbench.variables.clickSessionLink();
await app.workbench.variables.waitForVariableRow('df');

await app.workbench.console.pasteCodeToConsole('list(df.columns)');
Expand All @@ -97,15 +93,9 @@ test.describe('F1 Help', {
test('Python - Verifies basic F1 editor help functionality [C1062995]', async function ({ app, page, python }) {
await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'generate-data-frames-py', 'generate-data-frames.py'));

await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar');
await app.workbench.quickaccess.runCommand('workbench.action.toggleSidebarVisibility');
await app.workbench.quickaccess.runCommand('workbench.action.togglePanel');
await app.code.driver.page.locator('span').filter({ hasText: 'df = pd.DataFrame(data)' }).locator('span').first().dblclick();

await page.keyboard.press('F1');
await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar');
await app.workbench.quickaccess.runCommand('workbench.action.toggleSidebarVisibility');
await app.workbench.quickaccess.runCommand('workbench.action.togglePanel');

await expect(async () => {
const helpFrame = await app.workbench.help.getHelpFrame(0);
Expand All @@ -117,22 +107,12 @@ test.describe('F1 Help', {
test('Python - Verifies basic F1 notebook help functionality [C1062997]', async function ({ app, page, python }) {
await app.workbench.quickaccess.openDataFile(join(app.workspacePathOrFolder, 'workspaces', 'large_py_notebook', 'spotify.ipynb'));

await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar');
await app.workbench.quickaccess.runCommand('workbench.action.toggleSidebarVisibility');
await app.workbench.quickaccess.runCommand('workbench.action.togglePanel');
await app.code.driver.page.locator('span').filter({ hasText: 'warnings.filterwarnings(\'ignore\')' }).locator('span').first().dblclick();

// need to wait for notebook to be ready and cannot put this in retry loop as we are also
// in the middle of a windows workaround
await app.code.wait(10000);

await page.keyboard.press('F1');

await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar');
await app.workbench.quickaccess.runCommand('workbench.action.toggleSidebarVisibility');
await app.workbench.quickaccess.runCommand('workbench.action.togglePanel');
await expect(async () => {

await page.keyboard.press('F1');

// Note that we are getting help frame 1 instead of 0 because the notbook structure matches the same locators as help
const helpFrame = await app.workbench.help.getHelpFrame(1);

Expand Down

0 comments on commit 2fb274a

Please sign in to comment.