diff --git a/playwright.config.ts b/playwright.config.ts index bfddca3b2bb..1d7b6bcf7e0 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -30,6 +30,7 @@ export default defineConfig({ }, reporter: process.env.CI ? [ + // eslint-disable-next-line local/code-no-dangerous-type-assertions ['@midleman/github-actions-reporter', { title: '', useDetails: true, diff --git a/test/automation/src/positron/fixtures/positronUserSettingsFixtures.ts b/test/automation/src/positron/fixtures/positronUserSettingsFixtures.ts index f9a2c6dbd8c..4f5a5c7fe9b 100644 --- a/test/automation/src/positron/fixtures/positronUserSettingsFixtures.ts +++ b/test/automation/src/positron/fixtures/positronUserSettingsFixtures.ts @@ -43,7 +43,7 @@ export class PositronUserSettingsFixtures { ]); // Close the settings editor - await this.app.workbench.quickaccess.runCommand('workbench.action.closeActiveEditor'); + await this.app.workbench.positronQuickaccess.runCommand('workbench.action.closeActiveEditor'); // Restart the application if requested, to apply the settings if (restartApp) { diff --git a/test/automation/src/positron/positronConnections.ts b/test/automation/src/positron/positronConnections.ts index dc8f35bd877..f5062f62b33 100644 --- a/test/automation/src/positron/positronConnections.ts +++ b/test/automation/src/positron/positronConnections.ts @@ -3,10 +3,9 @@ * Licensed under the Elastic License 2.0. See LICENSE.txt for license information. *--------------------------------------------------------------------------------------------*/ - import { expect, Locator } from '@playwright/test'; import { Code } from '../code'; -import { QuickAccess } from '../quickaccess'; +import { PositronQuickAccess } from './positronQuickaccess'; const CONNECTIONS_CONTAINER = '.connections-items-container'; const CONNECTIONS_ITEM = '.connections-item'; @@ -22,7 +21,7 @@ export class PositronConnections { connectionItems: Locator; resumeConnectionButton: Locator; - constructor(private code: Code, private quickaccess: QuickAccess) { + constructor(private code: Code, private quickaccess: PositronQuickAccess) { this.deleteConnectionButton = code.driver.page.getByLabel('Delete Connection'); this.disconnectButton = code.driver.page.getByLabel('Disconnect'); this.connectIcon = code.driver.page.locator('.codicon-arrow-circle-right'); diff --git a/test/automation/src/positron/positronConsole.ts b/test/automation/src/positron/positronConsole.ts index 76527c20a9b..63a2f12d096 100644 --- a/test/automation/src/positron/positronConsole.ts +++ b/test/automation/src/positron/positronConsole.ts @@ -6,8 +6,8 @@ import { expect, Locator } from '@playwright/test'; import { Code } from '../code'; -import { QuickAccess } from '../quickaccess'; -import { QuickInput } from '../quickinput'; +import { PositronQuickAccess } from './positronQuickaccess'; +import { PositronQuickInput } from './positronQuickInput'; import { InterpreterInfo, InterpreterType } from './utils/positronInterpreterInfo'; import { IElement } from '../driver'; @@ -37,7 +37,7 @@ export class PositronConsole { return this.code.driver.getLocator(EMPTY_CONSOLE).getByText('There is no interpreter running'); } - constructor(private code: Code, private quickaccess: QuickAccess, private quickinput: QuickInput) { + constructor(private code: Code, private quickaccess: PositronQuickAccess, private quickinput: PositronQuickInput) { this.barPowerButton = this.code.driver.page.getByLabel('Shutdown console'); this.barRestartButton = this.code.driver.page.getByLabel('Restart console'); this.barClearButton = this.code.driver.page.getByLabel('Clear console'); diff --git a/test/automation/src/positron/positronNewProjectWizard.ts b/test/automation/src/positron/positronNewProjectWizard.ts index 283a838983b..12e997acd22 100644 --- a/test/automation/src/positron/positronNewProjectWizard.ts +++ b/test/automation/src/positron/positronNewProjectWizard.ts @@ -6,7 +6,7 @@ import { fail } from 'assert'; import { expect } from '@playwright/test'; import { Code } from '../code'; -import { QuickAccess } from '../quickaccess'; +import { PositronQuickAccess } from './positronQuickaccess'; // Selector for the pre-selected dropdown item in the project wizard const PROJECT_WIZARD_PRESELECTED_DROPDOWN_ITEM = @@ -53,7 +53,7 @@ export class PositronNewProjectWizard { private nextButton = this.code.driver.getLocator(PROJECT_WIZARD_DEFAULT_BUTTON).getByText('Next'); private createButton = this.code.driver.getLocator(PROJECT_WIZARD_DEFAULT_BUTTON).getByText('Create'); - constructor(private code: Code, private quickaccess: QuickAccess) { + constructor(private code: Code, private quickaccess: PositronQuickAccess) { this.projectTypeStep = new ProjectWizardProjectTypeStep(this.code); this.projectNameLocationStep = new ProjectWizardProjectNameLocationStep(this.code); this.rConfigurationStep = new ProjectWizardRConfigurationStep(this.code); @@ -115,7 +115,7 @@ class ProjectWizardProjectTypeStep { } async selectProjectType(projectType: ProjectType) { - const locator = this.code.driver.page.locator('label').filter({hasText: projectType}); + const locator = this.code.driver.page.locator('label').filter({ hasText: projectType }); await locator.click({ force: true }); } } diff --git a/test/automation/src/positron/positronNotebooks.ts b/test/automation/src/positron/positronNotebooks.ts index 1569ba816ea..1b3d615d8d8 100644 --- a/test/automation/src/positron/positronNotebooks.ts +++ b/test/automation/src/positron/positronNotebooks.ts @@ -5,11 +5,12 @@ import { Code } from '../code'; import { Notebook } from '../notebook'; -import { QuickAccess } from '../quickaccess'; -import { QuickInput } from '../quickinput'; +import { PositronQuickInput } from './positronQuickInput'; +import { PositronQuickAccess } from './positronQuickaccess'; import { basename } from 'path'; import { expect } from '@playwright/test'; + const KERNEL_LABEL = '.kernel-label'; const KERNEL_ACTION = '.kernel-action-view-item'; const SELECT_KERNEL_TEXT = 'Select Kernel'; @@ -34,7 +35,7 @@ export class PositronNotebooks { notebookProgressBar = this.code.driver.page.locator('[id="workbench\\.parts\\.editor"]').getByRole('progressbar'); - constructor(private code: Code, private quickinput: QuickInput, private quickaccess: QuickAccess, private notebook: Notebook) { } + constructor(private code: Code, private quickinput: PositronQuickInput, private quickaccess: PositronQuickAccess, private notebook: Notebook) { } async selectInterpreter(kernelGroup: string, desiredKernel: string) { await expect(this.notebookProgressBar).not.toBeVisible({ timeout: 30000 }); diff --git a/test/automation/src/positron/positronOutline.ts b/test/automation/src/positron/positronOutline.ts index 0ae5c8b19ca..32581bfe91a 100644 --- a/test/automation/src/positron/positronOutline.ts +++ b/test/automation/src/positron/positronOutline.ts @@ -6,7 +6,7 @@ import { fail } from 'assert'; import { Code } from '../code'; -import { QuickAccess } from '../quickaccess'; +import { PositronQuickAccess } from './positronQuickaccess'; const HORIZONTAL_SASH = '.explorer-viewlet .monaco-sash.horizontal'; const FOCUS_OUTLINE_COMMAND = 'outline.focus'; @@ -17,7 +17,7 @@ const OUTLINE_ELEMENT = '.outline-element'; */ export class PositronOutline { - constructor(private code: Code, private quickaccess: QuickAccess) { } + constructor(private code: Code, private quickaccess: PositronQuickAccess) { } async getOutlineData(): Promise { diff --git a/test/automation/src/positron/positronOutput.ts b/test/automation/src/positron/positronOutput.ts index fea3b556414..59b304cfa0b 100644 --- a/test/automation/src/positron/positronOutput.ts +++ b/test/automation/src/positron/positronOutput.ts @@ -5,8 +5,8 @@ import { Code } from '../code'; -import { QuickAccess } from '../quickaccess'; -import { QuickInput } from '../quickinput'; +import { PositronQuickAccess } from './positronQuickaccess'; +import { PositronQuickInput } from './positronQuickInput'; const OUTPUT_LINE = '.view-line'; @@ -15,7 +15,7 @@ const OUTPUT_LINE = '.view-line'; */ export class PositronOutput { - constructor(private code: Code, private quickaccess: QuickAccess, private quickinput: QuickInput) { } + constructor(private code: Code, private quickaccess: PositronQuickAccess, private quickinput: PositronQuickInput) { } async openOutputPane(outputPaneNameContains: string) { await this.quickaccess.runCommand('workbench.action.showOutputChannels', { keepOpen: true }); diff --git a/test/automation/src/positron/positronQuickInput.ts b/test/automation/src/positron/positronQuickInput.ts index 4b38b2db8ed..7407bfdaa78 100644 --- a/test/automation/src/positron/positronQuickInput.ts +++ b/test/automation/src/positron/positronQuickInput.ts @@ -10,31 +10,34 @@ export class PositronQuickInput { private static QUICK_INPUT = '.quick-input-widget'; private static QUICK_INPUT_INPUT = `${PositronQuickInput.QUICK_INPUT} .quick-input-box input`; - private static QUICK_INPUT_ROW = `${PositronQuickInput.QUICK_INPUT} .quick-input-list .monaco-list-row`; - private static QUICK_INPUT_FOCUSED_ELEMENT = `${PositronQuickInput.QUICK_INPUT_ROW}.focused .monaco-highlighted-label`; + private static QUICK_INPUT_RESULT = `${PositronQuickInput.QUICK_INPUT} .quick-input-list .monaco-list-row`; // Note: this only grabs the label and not the description or detail - private static QUICK_INPUT_ENTRY_LABEL = `${this.QUICK_INPUT_ROW} .quick-input-list-row > .monaco-icon-label .label-name`; - private static QUICK_INPUT_ENTRY_LABEL_SPAN = `${this.QUICK_INPUT_ROW} .monaco-highlighted-label`; + private static QUICK_INPUT_ENTRY_LABEL = `${this.QUICK_INPUT_RESULT} .quick-input-list-row > .monaco-icon-label .label-name`; private static QUICKINPUT_OK_BUTTON = '.quick-input-widget .quick-input-action a:has-text("OK")'; constructor(private code: Code) { } - async waitForQuickInputOpened(): Promise { - await expect(this.code.driver.page.locator(PositronQuickInput.QUICK_INPUT_INPUT)).toBeVisible(); + async waitForQuickInputOpened({ timeout = 10000 }: { timeout?: number } = {}): Promise { + await expect(this.code.driver.page.locator(PositronQuickInput.QUICK_INPUT_INPUT)).toBeVisible({ timeout }); } async type(value: string): Promise { await this.code.driver.page.locator(PositronQuickInput.QUICK_INPUT_INPUT).fill(value); } - async waitForQuickInputElementFocused(): Promise { - await expect(this.code.driver.page.locator(PositronQuickInput.QUICK_INPUT_FOCUSED_ELEMENT)).toBeFocused(); - } - async waitForQuickInputElementText(): Promise { - const quickInput = this.code.driver.page.locator(PositronQuickInput.QUICK_INPUT_ENTRY_LABEL_SPAN); - await expect(quickInput).not.toHaveText(''); - return await quickInput.textContent() || ''; + const quickInputResult = this.code.driver.page.locator(PositronQuickInput.QUICK_INPUT_RESULT); + + // Wait for at least one matching element with non-empty text + await expect(async () => { + const texts = await quickInputResult.allTextContents(); + return texts.some(text => text.trim() !== ''); + }).toPass(); + + // Retrieve the text content of the first matching element + const text = await quickInputResult.first().textContent(); + return text?.trim() || ''; + } async closeQuickInput(): Promise { @@ -57,17 +60,15 @@ export class PositronQuickInput { async selectQuickInputElement(index: number, keepOpen?: boolean): Promise { await this.waitForQuickInputOpened(); - for (let from = 0; from < index; from++) { - await this.code.driver.page.keyboard.press('Down'); - } - await this.code.driver.page.keyboard.press('Enter'); + await this.code.driver.page.locator(PositronQuickInput.QUICK_INPUT_RESULT).nth(index).click(); + if (!keepOpen) { await this.waitForQuickInputClosed(); } } async selectQuickInputElementContaining(text: string): Promise { - await this.code.driver.page.locator(`${PositronQuickInput.QUICK_INPUT_ROW}[aria-label*="${text}"]`).first().click({ timeout: 10000 }); + await this.code.driver.page.locator(`${PositronQuickInput.QUICK_INPUT_RESULT}[aria-label*="${text}"]`).first().click({ timeout: 10000 }); } async clickOkOnQuickInput(): Promise { diff --git a/test/automation/src/positron/positronQuickaccess.ts b/test/automation/src/positron/positronQuickaccess.ts index 3b23fd3430a..8d2f680225f 100644 --- a/test/automation/src/positron/positronQuickaccess.ts +++ b/test/automation/src/positron/positronQuickaccess.ts @@ -3,18 +3,95 @@ * Licensed under the Elastic License 2.0. See LICENSE.txt for license information. *--------------------------------------------------------------------------------------------*/ +import { Editors } from '../editors'; +import { Code } from '../code'; import { basename, isAbsolute } from 'path'; -import { QuickInput } from '../quickinput'; -import { QuickAccess } from '../quickaccess'; +import { PositronQuickInput } from './positronQuickInput'; +import { expect } from '@playwright/test'; +enum QuickAccessKind { + Files = 1, + Commands, + Symbols +} export class PositronQuickAccess { - constructor(private quickInput: QuickInput, - private quickAccess: QuickAccess) { } - + constructor(private code: Code, private editors: Editors, private quickInput: PositronQuickInput) { } async openDataFile(path: string): Promise { + if (!isAbsolute(path)) { + // we require absolute paths to get a single + // result back that is unique and avoid hitting + // the search process to reduce chances of + // search needing longer. + throw new Error('PositronQuickAccess.openFile requires an absolute path'); + } + + // quick access shows files with the basename of the path + await this.openFileQuickAccessAndWait(path, basename(path)); + + // open first element + await this.quickInput.selectQuickInputElement(0); + } + + async openFileQuickAccessAndWait( + searchValue: string, + expectedFirstElementNameOrExpectedResultCount: string | number + ): Promise { + // Clear editor history to ensure Quick Access is not "polluted" + await this.runCommand('workbench.action.clearEditorHistory'); + + await expect(async () => { + // Open Quick Access and wait for the elements to appear + await this.openQuickAccessWithRetry(QuickAccessKind.Files, searchValue); + + + await this.quickInput.waitForQuickInputElements((elementNames) => { + this.code.logger.log('QuickAccess: resulting elements:', elementNames); + + if (elementNames.length === 0) { + this.code.logger.log('QuickAccess: No elements found, retrying...'); + return false; // Retry polling + } + + const firstElementName = elementNames[0]; + + // Check if "No matching results" appears + if (firstElementName === 'No matching results') { + this.code.logger.log(`QuickAccess: File search returned "No matching results", retrying...`); + return false; // Retry polling + } + + // Handle expected result count + if (typeof expectedFirstElementNameOrExpectedResultCount === 'number') { + if (elementNames.length === expectedFirstElementNameOrExpectedResultCount) { + return true; // Condition met + } + this.code.logger.log( + `QuickAccess: Expected ${expectedFirstElementNameOrExpectedResultCount} results, got ${elementNames.length}, retrying...` + ); + return false; + } + + // Handle expected first element name + if (firstElementName === expectedFirstElementNameOrExpectedResultCount) { + return true; // Condition met + } + + this.code.logger.log( + `QuickAccess: Expected first result '${expectedFirstElementNameOrExpectedResultCount}', got '${firstElementName}', retrying...` + ); + return false; + }); + }).toPass({ + timeout: 15000, + }); + + this.code.logger.log('QuickAccess: File search succeeded.'); + } + + async openFile(path: string): Promise { if (!isAbsolute(path)) { // we require absolute paths to get a single // result back that is unique and avoid hitting @@ -23,10 +100,108 @@ export class PositronQuickAccess { throw new Error('QuickAccess.openFile requires an absolute path'); } + const fileName = basename(path); + // quick access shows files with the basename of the path - await this.quickAccess.openFileQuickAccessAndWait(path, basename(path)); + await this.openFileQuickAccessAndWait(path, basename(path)); // open first element await this.quickInput.selectQuickInputElement(0); + + // wait for editor being focused + await this.editors.waitForActiveTab(fileName); + await this.editors.selectTab(fileName); + } + + private async openQuickAccessWithRetry(kind: QuickAccessKind, value?: string): Promise { + // Other parts of code might steal focus away from quickinput :( + await expect(async () => { + // Open via keybinding + switch (kind) { + case QuickAccessKind.Files: + await this.code.driver.page.keyboard.press(process.platform === 'darwin' ? 'Meta+P' : 'Control+P'); + break; + case QuickAccessKind.Symbols: + await this.code.driver.page.keyboard.press(process.platform === 'darwin' ? 'Meta+Shift+O' : 'Control+Shift+O'); + break; + case QuickAccessKind.Commands: + await this.code.driver.page.keyboard.press(process.platform === 'darwin' ? 'Meta+Shift+P' : 'Control+Shift+P'); + break; + default: + throw new Error(`Unsupported QuickAccessKind: ${kind}`); + } + + // Await for quick input widget opened + try { + await this.quickInput.waitForQuickInputOpened(); + } catch (err) { + await this.code.driver.page.keyboard.press('Escape'); + throw err; + } + }).toPass({ + timeout: 15000, + intervals: [1000] + }); + + // Type value if any + if (value) { + await this.quickInput.type(value); + } + } + + + async runCommand(commandId: string, options?: { keepOpen?: boolean; exactLabelMatch?: boolean }): Promise { + const keepOpen = options?.keepOpen; + const exactLabelMatch = options?.exactLabelMatch; + + const openCommandPalletteAndTypeCommand = async (): Promise => { + // open commands picker + await this.openQuickAccessWithRetry(QuickAccessKind.Commands, `>${commandId}`); + + // wait for quick input element text + const text = await this.quickInput.waitForQuickInputElementText(); + + if (text === 'No matching commands' || (exactLabelMatch && text !== commandId)) { + return false; + } + + return true; + }; + + await expect(async () => { + const hasCommandFound = await openCommandPalletteAndTypeCommand(); + if (!hasCommandFound) { + this.code.logger.log(`QuickAccess: No matching commands, retrying...`); + await this.quickInput.closeQuickInput(); + throw new Error('Command not found'); // Signal to retry + } + }).toPass({ + timeout: 15000, + intervals: [1000], + }); + + this.code.logger.log('QuickAccess: Command found and successfully executed.'); + + // wait and click on best choice + await this.quickInput.selectQuickInputElement(0, keepOpen); + } + + async openQuickOutline({ timeout = 30000 }): Promise { + await expect(async () => { + // Open quick outline via keybinding + await this.openQuickAccessWithRetry(QuickAccessKind.Symbols); + + // Get the quick input element text + const text = await this.quickInput.waitForQuickInputElementText(); + + // Log the status + this.code.logger.log(`QuickAccess: Quick Outline returned text: "${text}"`); + + // Fail the retry if no symbols are found + if (text === 'No symbol information for the file') { + throw new Error('No symbol information for the file'); + } + }).toPass({ timeout }); } } + diff --git a/test/automation/src/workbench.ts b/test/automation/src/workbench.ts index dca6e77717a..928fe54b799 100644 --- a/test/automation/src/workbench.ts +++ b/test/automation/src/workbench.ts @@ -125,28 +125,28 @@ export class Workbench { // --- Start Positron --- this.positronPopups = new PositronPopups(code); this.positronInterpreterDropdown = new PositronInterpreterDropdown(code); - this.positronConsole = new PositronConsole(code, this.quickaccess, this.quickinput); this.positronVariables = new PositronVariables(code); this.positronDataExplorer = new PositronDataExplorer(code, this); this.positronSideBar = new PositronSideBar(code); this.positronPlots = new PositronPlots(code); - this.positronNotebooks = new PositronNotebooks(code, this.quickinput, this.quickaccess, this.notebook); - this.positronNewProjectWizard = new PositronNewProjectWizard(code, this.quickaccess); this.positronExplorer = new PositronExplorer(code); - this.positronConnections = new PositronConnections(code, this.quickaccess); this.positronHelp = new PositronHelp(code); this.positronTopActionBar = new PositronTopActionBar(code); this.positronLayouts = new PositronLayouts(code, this); - this.positronOutput = new PositronOutput(code, this.quickaccess, this.quickinput); + this.positronQuickInput = new PositronQuickInput(code); + this.positronQuickaccess = new PositronQuickAccess(code, this.editors, this.positronQuickInput); + this.positronConnections = new PositronConnections(code, this.positronQuickaccess); + this.positronNewProjectWizard = new PositronNewProjectWizard(code, this.positronQuickaccess); + this.positronOutput = new PositronOutput(code, this.positronQuickaccess, this.positronQuickInput); + this.positronConsole = new PositronConsole(code, this.positronQuickaccess, this.positronQuickInput); + this.positronNotebooks = new PositronNotebooks(code, this.positronQuickInput, this.positronQuickaccess, this.notebook); this.positronWelcome = new PositronWelcome(code); this.positronTerminal = new PositronTerminal(code); this.positronViewer = new PositronViewer(code); this.positronEditor = new PositronEditor(code); this.positronTestExplorer = new PositronTestExplorer(code); - this.positronQuickaccess = new PositronQuickAccess(this.quickinput, this.quickaccess); - this.positronOutline = new PositronOutline(code, this.quickaccess); + this.positronOutline = new PositronOutline(code, this.positronQuickaccess); this.positronClipboard = new PositronClipboard(code); - this.positronQuickInput = new PositronQuickInput(code); // --- End Positron --- } } diff --git a/test/e2e/areas/_test.setup.ts b/test/e2e/areas/_test.setup.ts index 95f2b5a96cc..de3ae25767f 100644 --- a/test/e2e/areas/_test.setup.ts +++ b/test/e2e/areas/_test.setup.ts @@ -12,6 +12,7 @@ import { join } from 'path'; import * as os from 'os'; import * as fs from 'fs'; import path = require('path'); +// eslint-disable-next-line local/code-import-patterns import { rename, rm, access, mkdir } from 'fs/promises'; import { constants } from 'fs'; import { randomUUID } from 'crypto'; @@ -139,7 +140,7 @@ export const test = base.extend({ { scope: 'test' }], devTools: [async ({ app }, use) => { - await app.workbench.quickaccess.runCommand('workbench.action.toggleDevTools'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleDevTools'); await use(); }, diff --git a/test/e2e/areas/action-bar/editor-action-bar.test.ts b/test/e2e/areas/action-bar/editor-action-bar.test.ts index 92b7fca48b9..c291c88ca3b 100644 --- a/test/e2e/areas/action-bar/editor-action-bar.test.ts +++ b/test/e2e/areas/action-bar/editor-action-bar.test.ts @@ -18,7 +18,7 @@ test.describe('Editor Action Bar', { }); test.afterEach(async function ({ app }) { - await app.workbench.quickaccess.runCommand('workbench.action.closeAllEditors'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.closeAllEditors'); }); test('Quarto Document [C1080700]', { @@ -103,7 +103,7 @@ test.describe('Editor Action Bar', { async function openFile(app, filePath: string) { const fileName = path.basename(filePath); await test.step(`open file: ${fileName}`, async () => { - await app.workbench.quickaccess.openFile(path.join(app.workspacePathOrFolder, filePath)); + await app.workbench.positronQuickaccess.openFile(path.join(app.workspacePathOrFolder, filePath)); }); } diff --git a/test/e2e/areas/apps/python-apps.test.ts b/test/e2e/areas/apps/python-apps.test.ts index e5ac928ab22..f19f93ae99f 100644 --- a/test/e2e/areas/apps/python-apps.test.ts +++ b/test/e2e/areas/apps/python-apps.test.ts @@ -14,9 +14,9 @@ test.describe('Python Applications', { tag: [tags.CRITICAL, tags.APPS, tags.VIEWER, tags.EDITOR] }, () => { test.afterEach(async function ({ app }) { - await app.workbench.quickaccess.runCommand('workbench.action.closeAllEditors'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.closeAllEditors'); - await app.workbench.quickaccess.runCommand('workbench.action.terminal.focus'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.terminal.focus'); await app.workbench.positronTerminal.sendKeysToTerminal('Control+C'); // unreliable on ubuntu: // await this.app.workbench.terminal.waitForTerminalText(buffer => buffer.some(line => line.includes('^C'))); @@ -27,7 +27,7 @@ test.describe('Python Applications', { test('Python - Verify Basic Dash App [C903305]', { tag: [tags.WIN] }, async function ({ app, python }) { const viewer = app.workbench.positronViewer; - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'python_apps', 'dash_example', 'dash_example.py')); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'python_apps', 'dash_example', 'dash_example.py')); await app.workbench.positronEditor.pressPlay(); await expect(viewer.getViewerFrame().getByText('Hello World')).toBeVisible({ timeout: 30000 }); @@ -44,7 +44,7 @@ test.describe('Python Applications', { test('Python - Verify Basic FastAPI App [C903306]', async function ({ app, python }) { const viewer = app.workbench.positronViewer; - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'python_apps', 'fastapi_example', 'fastapi_example.py')); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'python_apps', 'fastapi_example', 'fastapi_example.py')); await app.workbench.positronEditor.pressPlay(); await expect(viewer.getViewerFrame().getByText('FastAPI')).toBeVisible({ timeout: 30000 }); @@ -64,13 +64,13 @@ test.describe('Python Applications', { }, async function ({ app, python }) { const viewer = app.workbench.positronViewer; - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'python_apps', 'gradio_example', 'gradio_example.py')); - await app.workbench.quickaccess.runCommand('workbench.action.toggleSidebarVisibility'); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'python_apps', 'gradio_example', 'gradio_example.py')); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleSidebarVisibility'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); await app.workbench.positronEditor.pressPlay(); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); await expect(viewer.getViewerFrame().getByRole('button', { name: 'Submit' })).toBeVisible({ timeout: 45000 }); - await app.workbench.quickaccess.runCommand('workbench.action.toggleSidebarVisibility'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleSidebarVisibility'); }); test('Python - Verify Basic Streamlit App [C903308]', { @@ -78,7 +78,7 @@ test.describe('Python Applications', { }, async function ({ app, python }) { const viewer = app.workbench.positronViewer; - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'python_apps', 'streamlit_example', 'streamlit_example.py')); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'python_apps', 'streamlit_example', 'streamlit_example.py')); await app.workbench.positronEditor.pressPlay(); await app.workbench.positronLayouts.enterLayout('fullSizedAuxBar'); @@ -113,9 +113,9 @@ test.describe('Python Applications', { }, async function ({ app, python, page }) { const viewer = app.workbench.positronViewer; - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'python_apps', 'flask_example', '__init__.py')); - await app.workbench.quickaccess.runCommand('workbench.action.toggleSidebarVisibility'); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'python_apps', 'flask_example', '__init__.py')); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleSidebarVisibility'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); await app.workbench.positronEditor.pressPlay(); const viewerFrame = viewer.getViewerFrame(); const loginLocator = app.web @@ -140,7 +140,7 @@ test.describe('Python Applications', { await expect(loginLocator).toBeVisible({ timeout: 30000 }); }); - await app.workbench.quickaccess.runCommand('workbench.action.toggleSidebarVisibility'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleSidebarVisibility'); }); }); diff --git a/test/e2e/areas/apps/shiny.test.ts b/test/e2e/areas/apps/shiny.test.ts index 2cfd864aa38..c6071200419 100644 --- a/test/e2e/areas/apps/shiny.test.ts +++ b/test/e2e/areas/apps/shiny.test.ts @@ -27,8 +27,8 @@ test.describe('Shiny Application', { tag: [tags.APPS, tags.VIEWER, tags.WIN] }, }); test('Python - Verify Basic Shiny App [C699099]', async function ({ app, python }) { - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'shiny-py-example', 'app.py')); - await app.workbench.quickaccess.runCommand('shiny.python.runApp'); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'shiny-py-example', 'app.py')); + await app.workbench.positronQuickaccess.runCommand('shiny.python.runApp'); const headerLocator = app.workbench.positronViewer.getViewerLocator('h1'); await expect(async () => { await expect(headerLocator).toHaveText('Restaurant tipping', { timeout: 20000 }); diff --git a/test/e2e/areas/connections/connections-db.test.ts b/test/e2e/areas/connections/connections-db.test.ts index 2dc15ac2a6a..91746ad86cd 100644 --- a/test/e2e/areas/connections/connections-db.test.ts +++ b/test/e2e/areas/connections/connections-db.test.ts @@ -27,8 +27,8 @@ test.describe('SQLite DB Connection', { annotation: [{ type: 'issue', description: 'https://github.com/posit-dev/positron/issues/5692' }] }, async function ({ app, python }) { await test.step('Open a Python file and run it', async () => { - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'chinook-db-py', 'chinook-sqlite.py')); - await app.workbench.quickaccess.runCommand('python.execInConsole'); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'chinook-db-py', 'chinook-sqlite.py')); + await app.workbench.positronQuickaccess.runCommand('python.execInConsole'); }); await test.step('Open connections pane', async () => { @@ -57,8 +57,8 @@ test.describe('SQLite DB Connection', { test('R - SQLite DB Connection [C628637]', async function ({ app, r }) { await test.step('Open an R file and run it', async () => { - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'chinook-db-r', 'chinook-sqlite.r')); - await app.workbench.quickaccess.runCommand('r.sourceCurrentFile'); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'chinook-db-r', 'chinook-sqlite.r')); + await app.workbench.positronQuickaccess.runCommand('r.sourceCurrentFile'); }); await test.step('Open connections pane', async () => { diff --git a/test/e2e/areas/console/console-clipboard.test.ts b/test/e2e/areas/console/console-clipboard.test.ts index b4c95c1cab8..f014af47e88 100644 --- a/test/e2e/areas/console/console-clipboard.test.ts +++ b/test/e2e/areas/console/console-clipboard.test.ts @@ -36,7 +36,7 @@ async function testConsoleClipboard(app: Application) { async function toggleAuxiliaryBar(app: Application) { await test.step('Toggle auxiliary bar', async () => { - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); }); } diff --git a/test/e2e/areas/console/console-history.test.ts b/test/e2e/areas/console/console-history.test.ts index 9482ea7d011..af3293087a7 100644 --- a/test/e2e/areas/console/console-history.test.ts +++ b/test/e2e/areas/console/console-history.test.ts @@ -60,8 +60,8 @@ async function enterLines(app: Application, lines: string[]) { async function clearConsole(app: Application) { await test.step('Clear the console', async () => { - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); - await app.workbench.quickaccess.runCommand('workbench.action.toggleSidebarVisibility'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleSidebarVisibility'); await app.workbench.positronConsole.barClearButton.click(); }); } @@ -79,11 +79,11 @@ async function selectFirstHistoryResult(app: Application, expectedLine: string) async function verifyFullHistory(app: Application, lines: string[]) { await test.step('Verify the full history', async () => { - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); await app.workbench.positronConsole.barClearButton.click(); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); - await app.workbench.quickaccess.runCommand('workbench.action.toggleSidebarVisibility'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleSidebarVisibility'); await app.code.driver.page.keyboard.press('Control+R'); await app.workbench.positronConsole.waitForHistoryContents(lines[0], 2); diff --git a/test/e2e/areas/console/console-python.test.ts b/test/e2e/areas/console/console-python.test.ts index befe28b52ba..1821576b259 100644 --- a/test/e2e/areas/console/console-python.test.ts +++ b/test/e2e/areas/console/console-python.test.ts @@ -13,7 +13,7 @@ test.describe('Console Pane: Python', { tag: [tags.WEB, tags.WIN, tags.CONSOLE] test('Verify restart button inside the console [C377918]', async function ({ app, python }) { await expect(async () => { - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); await app.workbench.positronConsole.barClearButton.click(); // workaround issue where power button click fails @@ -21,7 +21,7 @@ test.describe('Console Pane: Python', { tag: [tags.WEB, tags.WIN, tags.CONSOLE] await app.workbench.positronConsole.barPowerButton.click(); await app.workbench.positronConsole.consoleRestartButton.click(); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); await app.workbench.positronConsole.waitForReady('>>>'); await app.workbench.positronConsole.waitForConsoleContents('restarted'); await expect(app.workbench.positronConsole.consoleRestartButton).not.toBeVisible(); @@ -31,14 +31,14 @@ test.describe('Console Pane: Python', { tag: [tags.WEB, tags.WIN, tags.CONSOLE] test('Verify restart button on console bar [C617464]', { }, async function ({ app, python }) { // Need to make console bigger to see all bar buttons - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); await app.workbench.positronConsole.barClearButton.click(); // workaround issue where "started" text never appears post restart await app.code.wait(1000); await app.workbench.positronConsole.barRestartButton.click(); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); await app.workbench.positronConsole.waitForReady('>>>'); await app.workbench.positronConsole.waitForConsoleContents('restarted'); }); diff --git a/test/e2e/areas/console/console-r.test.ts b/test/e2e/areas/console/console-r.test.ts index 1b3c3103f7b..76c28025eae 100644 --- a/test/e2e/areas/console/console-r.test.ts +++ b/test/e2e/areas/console/console-r.test.ts @@ -14,7 +14,7 @@ test.describe('Console Pane: R', { }, () => { test.beforeAll(async function ({ app }) { // Need to make console bigger to see all bar buttons - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); }); test('Verify restart button inside the console [C377917]', async function ({ app, r }) { diff --git a/test/e2e/areas/data-explorer/data-explorer-python-pandas.test.ts b/test/e2e/areas/data-explorer/data-explorer-python-pandas.test.ts index 4d2fc0de181..aa947ad8e93 100644 --- a/test/e2e/areas/data-explorer/data-explorer-python-pandas.test.ts +++ b/test/e2e/areas/data-explorer/data-explorer-python-pandas.test.ts @@ -125,11 +125,11 @@ df2 = pd.DataFrame(data)`; // This test is not dependent on the previous test, so it refreshes the python environment test('Python Pandas - Verifies data explorer test.afterAll modification [C557574]', async function ({ app, python }) { // Restart python for clean environment & open the file - await app.workbench.quickaccess.runCommand('workbench.action.closeAllEditors', { keepOpen: false }); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.closeAllEditors', { keepOpen: false }); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); await app.workbench.positronConsole.barClearButton.click(); await app.workbench.positronConsole.barRestartButton.click(); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); await expect(app.workbench.positronConsole.activeConsole.getByText('restarted')).toBeVisible({ timeout: 60000 }); const filename = 'pandas-update-dataframe.ipynb'; @@ -188,7 +188,7 @@ df2 = pd.DataFrame(data)`; from pydataset import data Data_Frame = data('mtcars')`; await app.workbench.positronConsole.executeCode('Python', script, '>>>'); - await app.workbench.quickaccess.runCommand('workbench.panel.positronVariables.focus'); + await app.workbench.positronQuickaccess.runCommand('workbench.panel.positronVariables.focus'); if (app.web) { await app.workbench.positronVariables.selectVariablesGroup(`${process.env.POSITRON_PY_VER_SEL!}`); @@ -201,7 +201,7 @@ Data_Frame = data('mtcars')`; // Now move focus out of the the data explorer pane await app.workbench.editors.newUntitledFile(); - await app.workbench.quickaccess.runCommand('workbench.panel.positronVariables.focus'); + await app.workbench.positronQuickaccess.runCommand('workbench.panel.positronVariables.focus'); await app.workbench.positronVariables.doubleClickVariableRow('Data_Frame'); await expect(async () => { @@ -209,7 +209,7 @@ Data_Frame = data('mtcars')`; }).toPass(); await app.workbench.positronDataExplorer.closeDataExplorer(); - await app.workbench.quickaccess.runCommand('workbench.panel.positronVariables.focus'); + await app.workbench.positronQuickaccess.runCommand('workbench.panel.positronVariables.focus'); }); test('Python - Check blank spaces in data explorer [C1078835]', async function ({ app, python }) { diff --git a/test/e2e/areas/data-explorer/data-explorer-python-polars.test.ts b/test/e2e/areas/data-explorer/data-explorer-python-polars.test.ts index 5044fe78793..299c0dc8b48 100644 --- a/test/e2e/areas/data-explorer/data-explorer-python-polars.test.ts +++ b/test/e2e/areas/data-explorer/data-explorer-python-polars.test.ts @@ -14,8 +14,8 @@ test.describe('Data Explorer - Python Polars', { tag: [tags.WIN, tags.WEB, tags.CRITICAL, tags.DATA_EXPLORER] }, () => { test('Python Polars - Verifies basic data explorer functionality [C644538]', async function ({ app, python, logger }) { - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'polars-dataframe-py', 'polars_basic.py')); - await app.workbench.quickaccess.runCommand('python.execInConsole'); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'polars-dataframe-py', 'polars_basic.py')); + await app.workbench.positronQuickaccess.runCommand('python.execInConsole'); logger.log('Opening data grid'); await expect(async () => { diff --git a/test/e2e/areas/data-explorer/data-explorer-r.test.ts b/test/e2e/areas/data-explorer/data-explorer-r.test.ts index 6bcae4748ce..42edac31c20 100644 --- a/test/e2e/areas/data-explorer/data-explorer-r.test.ts +++ b/test/e2e/areas/data-explorer/data-explorer-r.test.ts @@ -72,7 +72,7 @@ test.describe('Data Explorer - R ', { await app.workbench.positronSideBar.closeSecondarySideBar(); await app.workbench.positronDataExplorer.closeDataExplorer(); - await app.workbench.quickaccess.runCommand('workbench.panel.positronVariables.focus'); + await app.workbench.positronQuickaccess.runCommand('workbench.panel.positronVariables.focus'); }); @@ -83,7 +83,7 @@ test.describe('Data Explorer - R ', { // and https://github.com/posit-dev/positron/issues/5714 const script = `Data_Frame <- mtcars`; await app.workbench.positronConsole.executeCode('R', script, '>'); - await app.workbench.quickaccess.runCommand('workbench.panel.positronVariables.focus'); + await app.workbench.positronQuickaccess.runCommand('workbench.panel.positronVariables.focus'); await expect(async () => { await app.workbench.positronVariables.doubleClickVariableRow('Data_Frame'); @@ -92,7 +92,7 @@ test.describe('Data Explorer - R ', { // Now move focus out of the the data explorer pane await app.workbench.editors.newUntitledFile(); - await app.workbench.quickaccess.runCommand('workbench.panel.positronVariables.focus'); + await app.workbench.positronQuickaccess.runCommand('workbench.panel.positronVariables.focus'); await app.workbench.positronVariables.doubleClickVariableRow('Data_Frame'); await expect(async () => { @@ -100,7 +100,7 @@ test.describe('Data Explorer - R ', { }).toPass(); await app.workbench.positronDataExplorer.closeDataExplorer(); - await app.workbench.quickaccess.runCommand('workbench.panel.positronVariables.focus'); + await app.workbench.positronQuickaccess.runCommand('workbench.panel.positronVariables.focus'); }); test('R - Check blank spaces in data explorer [C1078834]', async function ({ app, r }) { diff --git a/test/e2e/areas/data-explorer/large-data-frame.test.ts b/test/e2e/areas/data-explorer/large-data-frame.test.ts index f37ef631ef9..db6866d2e21 100644 --- a/test/e2e/areas/data-explorer/large-data-frame.test.ts +++ b/test/e2e/areas/data-explorer/large-data-frame.test.ts @@ -26,8 +26,8 @@ test.describe('Data Explorer - Large Data Frame', { }); test('Python - Verifies data explorer functionality with large data frame [C557555]', async function ({ app, python, logger }) { - 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.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'nyc-flights-data-py', 'flights-data-frame.py')); + await app.workbench.positronQuickaccess.runCommand('python.execInConsole'); logger.log('Opening data grid'); await expect(async () => { @@ -60,8 +60,8 @@ test.describe('Data Explorer - Large Data Frame', { test('R - Verifies data explorer functionality with large data frame [C557554]', { tag: [tags.WEB, tags.CRITICAL] }, async function ({ app, logger, r }) { - 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.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'nyc-flights-data-r', 'flights-data-frame.r')); + await app.workbench.positronQuickaccess.runCommand('r.sourceCurrentFile'); logger.log('Opening data grid'); await expect(async () => { diff --git a/test/e2e/areas/data-explorer/sparklines.test.ts b/test/e2e/areas/data-explorer/sparklines.test.ts index 51a75a55409..70c6f715ff2 100644 --- a/test/e2e/areas/data-explorer/sparklines.test.ts +++ b/test/e2e/areas/data-explorer/sparklines.test.ts @@ -19,7 +19,7 @@ test.describe('Data Explorer - Sparklines', { }); test.afterEach(async ({ app }) => { - await app.workbench.quickaccess.runCommand('workbench.action.closeAllEditors', { keepOpen: false }); + await app.workbench.positronQuickaccess.runCommand('workbench.action.closeAllEditors', { keepOpen: false }); }); test('Python Pandas - Verifies downward trending graph [C830552]', async ({ app, python }) => { @@ -43,7 +43,7 @@ async function openDataExplorerColumnProfile(app: Application, variableName: str await app.code.driver.getLocator(`.label-name:has-text("Data: ${variableName}")`).innerText(); }).toPass(); - await app.workbench.quickaccess.runCommand('workbench.action.toggleSidebarVisibility'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleSidebarVisibility'); await app.workbench.positronSideBar.closeSecondarySideBar(); await app.workbench.positronDataExplorer.getDataExplorerTableData(); await app.workbench.positronDataExplorer.expandColumnProfile(0); diff --git a/test/e2e/areas/data-explorer/very-large-data-frame.test.ts b/test/e2e/areas/data-explorer/very-large-data-frame.test.ts index 49ba79c9d75..ad446e686a6 100644 --- a/test/e2e/areas/data-explorer/very-large-data-frame.test.ts +++ b/test/e2e/areas/data-explorer/very-large-data-frame.test.ts @@ -42,8 +42,8 @@ test.describe('Data Explorer - Very Large Data Frame', { tag: [tags.WIN, tags.DA test.describe('Python Data Explorer (Very Large Data Frame)', () => { if (githubActions) { test('Python - Verifies data explorer functionality with very large unique data dataframe [C804823]', async function ({ app, logger, python }) { - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'performance', 'loadBigParquet.py')); - await app.workbench.quickaccess.runCommand('python.execInConsole'); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'performance', 'loadBigParquet.py')); + await app.workbench.positronQuickaccess.runCommand('python.execInConsole'); const startTime = performance.now(); logger.log('Opening data grid'); @@ -67,8 +67,8 @@ test.describe('Data Explorer - Very Large Data Frame', { tag: [tags.WIN, tags.DA } else { test('Python - Verifies data explorer functionality with very large duplicated data dataframe [C807824]', async function ({ app, logger, python }) { - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'performance', 'multiplyParquet.py')); - await app.workbench.quickaccess.runCommand('python.execInConsole'); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'performance', 'multiplyParquet.py')); + await app.workbench.positronQuickaccess.runCommand('python.execInConsole'); const startTime = performance.now(); logger.log('Opening data grid'); @@ -96,8 +96,8 @@ test.describe('Data Explorer - Very Large Data Frame', { tag: [tags.WIN, tags.DA test.describe('R Data Explorer (Very Large Data Frame)', () => { if (githubActions) { test('R - Verifies data explorer functionality with very large unique data dataframe [C804824]', async function ({ app, logger, r }) { - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'performance', 'loadBigParquet.r')); - await app.workbench.quickaccess.runCommand('r.sourceCurrentFile'); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'performance', 'loadBigParquet.r')); + await app.workbench.positronQuickaccess.runCommand('r.sourceCurrentFile'); const startTime = performance.now(); logger.log('Opening data grid'); @@ -122,8 +122,8 @@ test.describe('Data Explorer - Very Large Data Frame', { tag: [tags.WIN, tags.DA } else { test('R - Verifies data explorer functionality with very large duplicated data dataframe [C807825]', async function ({ app, logger, r }) { - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'performance', 'multiplyParquet.r')); - await app.workbench.quickaccess.runCommand('r.sourceCurrentFile'); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'performance', 'multiplyParquet.r')); + await app.workbench.positronQuickaccess.runCommand('r.sourceCurrentFile'); const startTime = performance.now(); logger.log('Opening data grid'); diff --git a/test/e2e/areas/data-explorer/xlsx-data-frame.test.ts b/test/e2e/areas/data-explorer/xlsx-data-frame.test.ts index 5b664e6c808..a09a6e44674 100644 --- a/test/e2e/areas/data-explorer/xlsx-data-frame.test.ts +++ b/test/e2e/areas/data-explorer/xlsx-data-frame.test.ts @@ -20,8 +20,8 @@ test.describe('Data Explorer - XLSX', { }); test('Python - Verifies data explorer functionality with XLSX input [C632940]', async function ({ app, python, logger }) { - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'read-xlsx-py', 'supermarket-sales.py')); - await app.workbench.quickaccess.runCommand('python.execInConsole'); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'read-xlsx-py', 'supermarket-sales.py')); + await app.workbench.positronQuickaccess.runCommand('python.execInConsole'); logger.log('Opening data grid'); await expect(async () => { @@ -37,8 +37,8 @@ test.describe('Data Explorer - XLSX', { }); test('R - Verifies data explorer functionality with XLSX input [C632941]', async function ({ app, r, logger }) { - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'read-xlsx-r', 'supermarket-sales.r')); - await app.workbench.quickaccess.runCommand('r.sourceCurrentFile'); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'read-xlsx-r', 'supermarket-sales.r')); + await app.workbench.positronQuickaccess.runCommand('r.sourceCurrentFile'); logger.log('Opening data grid'); await expect(async () => { diff --git a/test/e2e/areas/editor/fast-execution.test.ts b/test/e2e/areas/editor/fast-execution.test.ts index 54f62ade047..8ddedbb7352 100644 --- a/test/e2e/areas/editor/fast-execution.test.ts +++ b/test/e2e/areas/editor/fast-execution.test.ts @@ -14,7 +14,7 @@ const FILENAME = 'fast-execution.r'; test.describe('R Fast Execution', { tag: [tags.WEB, tags.EDITOR, tags.WIN] }, () => { test('Verify fast execution is not out of order [C712539]', async function ({ app, r }) { - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'fast-statement-execution', FILENAME)); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'fast-statement-execution', FILENAME)); let previousTop = -1; diff --git a/test/e2e/areas/help/f1.test.ts b/test/e2e/areas/help/f1.test.ts index 72de69a50d8..26d747be2f9 100644 --- a/test/e2e/areas/help/f1.test.ts +++ b/test/e2e/areas/help/f1.test.ts @@ -16,15 +16,15 @@ test.describe('F1 Help', { }, () => { test.afterEach(async function ({ app }) { - await app.workbench.quickaccess.runCommand('workbench.action.closeAllEditors'); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.closeAllEditors'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); await app.workbench.positronConsole.barClearButton.click(); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); }); test('R - Verifies basic F1 console help functionality [C1018854]', async function ({ app, page, r }) { - 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.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'nyc-flights-data-r', 'flights-data-frame.r')); + await app.workbench.positronQuickaccess.runCommand('r.sourceCurrentFile'); await app.workbench.positronConsole.pasteCodeToConsole('colnames(df2)'); await app.workbench.positronConsole.doubleClickConsoleText('colnames'); @@ -38,16 +38,16 @@ 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.positronQuickaccess.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.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleSidebarVisibility'); + await app.workbench.positronQuickaccess.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 app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleSidebarVisibility'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.togglePanel'); await expect(async () => { const helpFrame = await app.workbench.positronHelp.getHelpFrame(0); @@ -76,8 +76,8 @@ test.describe('F1 Help', { }); test('Python - Verifies basic F1 console help functionality [C1062993]', async function ({ app, page, python }) { - 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.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'nyc-flights-data-py', 'flights-data-frame.py')); + await app.workbench.positronQuickaccess.runCommand('python.execInConsole'); await app.workbench.positronConsole.pasteCodeToConsole('list(df.columns)'); await app.workbench.positronConsole.doubleClickConsoleText('list'); @@ -91,17 +91,17 @@ 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.positronQuickaccess.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.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleSidebarVisibility'); + await app.workbench.positronQuickaccess.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 app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleSidebarVisibility'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.togglePanel'); await expect(async () => { const helpFrame = await app.workbench.positronHelp.getHelpFrame(0); @@ -113,9 +113,9 @@ test.describe('F1 Help', { test('Python - Verifies basic F1 notebook help functionality [C1062997]', async function ({ app, page, python }) { await app.workbench.positronQuickaccess.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.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleSidebarVisibility'); + await app.workbench.positronQuickaccess.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 @@ -124,9 +124,9 @@ test.describe('F1 Help', { 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 app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleSidebarVisibility'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.togglePanel'); await expect(async () => { // Note that we are getting help frame 1 instead of 0 because the notbook structure matches the same locators as help diff --git a/test/e2e/areas/new-project-wizard/new-project-python.test.ts b/test/e2e/areas/new-project-wizard/new-project-python.test.ts index eb30818833b..2cfa0a0ba03 100644 --- a/test/e2e/areas/new-project-wizard/new-project-python.test.ts +++ b/test/e2e/areas/new-project-wizard/new-project-python.test.ts @@ -39,9 +39,9 @@ test.describe('Python - New Project Wizard', { tag: [tags.NEW_PROJECT_WIZARD] }, }).toPass({ timeout: 50000 }); // The console should initialize without any prompts to install ipykernel await expect(app.workbench.positronConsole.activeConsole.getByText('>>>')).toBeVisible({ timeout: 45000 }); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); await app.workbench.positronConsole.barClearButton.click(); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); }); test('Create a new Venv environment [C627912]', { tag: [tags.CRITICAL, tags.WIN] }, async function ({ app, page }) { @@ -56,9 +56,9 @@ test.describe('Python - New Project Wizard', { tag: [tags.NEW_PROJECT_WIZARD] }, await pw.currentOrNewWindowSelectionModal.currentWindowButton.click(); await expect(page.getByRole('button', { name: `Explorer Section: ${defaultProjectName + projSuffix}` })).toBeVisible({ timeout: 20000 }); await expect(app.workbench.positronConsole.activeConsole.getByText('>>>')).toBeVisible({ timeout: 100000 }); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); await app.workbench.positronConsole.barClearButton.click(); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); }); // Skip test due to https://github.com/posit-dev/positron/issues/5730. Both have to skipped as they depend o @@ -116,7 +116,7 @@ test.describe('Python - New Project Wizard', { tag: [tags.NEW_PROJECT_WIZARD] }, await app.workbench.positronInterpreterDropdown.closeInterpreterDropdown(); await app.workbench.positronConsole.typeToConsole('pip uninstall -y ipykernel'); await app.workbench.positronConsole.sendEnterKey(); - await app.workbench.positronConsole.waitForConsoleContents('Successfully uninstalled ipykernel') + await app.workbench.positronConsole.waitForConsoleContents('Successfully uninstalled ipykernel'); // Create a new Python project and use the selected python interpreter await pw.startNewProject(ProjectType.PYTHON_PROJECT); @@ -147,9 +147,9 @@ test.describe('Python - New Project Wizard', { tag: [tags.NEW_PROJECT_WIZARD] }, // If ipykernel was successfully installed during the new project initialization, // the console should be ready without any prompts to install ipykernel await expect(app.workbench.positronConsole.activeConsole.getByText('>>>')).toBeVisible({ timeout: 90000 }); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); await app.workbench.positronConsole.barClearButton.click(); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); }); test('Default Python Project with git init [C674522]', { tag: [tags.CRITICAL, tags.WIN] }, async function ({ app, page }) { diff --git a/test/e2e/areas/new-project-wizard/new-project-r-jupyter.test.ts b/test/e2e/areas/new-project-wizard/new-project-r-jupyter.test.ts index cd3aaa74939..62b95fabb5b 100644 --- a/test/e2e/areas/new-project-wizard/new-project-r-jupyter.test.ts +++ b/test/e2e/areas/new-project-wizard/new-project-r-jupyter.test.ts @@ -62,7 +62,7 @@ test.describe('R - New Project Wizard', { tag: [tags.NEW_PROJECT_WIZARD] }, () = // await app.workbench.positronConsole.sendEnterKey(); await app.workbench.positronLayouts.enterLayout("fullSizedSidebar"); - await expect(app.code.driver.page.getByRole('button', { name: `Explorer Section: ${defaultProjectName + projSuffix}` })).toBeVisible({ timeout: 15000 }); + await expect(app.code.driver.page.getByRole('button', { name: 'Explorer Section: my-r-' })).toHaveText(defaultProjectName + projSuffix, { timeout: 15000 }); // Verify renv files are present await expect(async () => { const projectFiles = await app.workbench.positronExplorer.getExplorerProjectFiles(); @@ -86,7 +86,7 @@ test.describe('R - New Project Wizard', { tag: [tags.NEW_PROJECT_WIZARD] }, () = await pw.rConfigurationStep.renvCheckbox.click(); await pw.navigate(ProjectWizardNavigateAction.CREATE); await pw.currentOrNewWindowSelectionModal.currentWindowButton.click(); - await expect(app.code.driver.page.getByRole('button', { name: `Explorer Section: ${defaultProjectName + projSuffix}` })).toBeVisible({ timeout: 15000 }); + await expect(app.code.driver.page.getByRole('button', { name: 'Explorer Section: my-r-' })).toHaveText(defaultProjectName + projSuffix, { timeout: 15000 }); // Verify renv files are present await expect(async () => { const projectFiles = await app.workbench.positronExplorer.getExplorerProjectFiles(); @@ -113,7 +113,7 @@ test.describe('R - New Project Wizard', { tag: [tags.NEW_PROJECT_WIZARD] }, () = await pw.rConfigurationStep.renvCheckbox.click(); await pw.navigate(ProjectWizardNavigateAction.CREATE); await pw.currentOrNewWindowSelectionModal.currentWindowButton.click(); - await expect(app.code.driver.page.getByRole('button', { name: `Explorer Section: ${defaultProjectName + projSuffix}` })).toBeVisible({ timeout: 15000 }); + await expect(app.code.driver.page.getByRole('button', { name: 'Explorer Section: my-r-' })).toHaveText(defaultProjectName + projSuffix, { timeout: 15000 }); // Interact with the modal to skip installing renv await app.workbench.positronPopups.installRenv(false); // Verify renv files are **not** present diff --git a/test/e2e/areas/notebook/notebook-large-python.test.ts b/test/e2e/areas/notebook/notebook-large-python.test.ts index 61d875dcb59..34d0e45c252 100644 --- a/test/e2e/areas/notebook/notebook-large-python.test.ts +++ b/test/e2e/areas/notebook/notebook-large-python.test.ts @@ -26,7 +26,7 @@ test.describe('Large Python Notebook', { await notebooks.runAllCells(120000); - await app.workbench.quickaccess.runCommand('notebook.focusTop'); + await app.workbench.positronQuickaccess.runCommand('notebook.focusTop'); await app.code.driver.page.locator('span').filter({ hasText: 'import pandas as pd' }).locator('span').first().click(); const allFigures: any[] = []; diff --git a/test/e2e/areas/outline/outline.test.ts b/test/e2e/areas/outline/outline.test.ts index 0f30ddcc898..32551d3c1be 100644 --- a/test/e2e/areas/outline/outline.test.ts +++ b/test/e2e/areas/outline/outline.test.ts @@ -15,7 +15,7 @@ test.describe('Outline #web #win', { }, () => { test('Python - Verify Outline Contents [C956870]', async function ({ app, python }) { - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'chinook-db-py', 'chinook-sqlite.py')); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'chinook-db-py', 'chinook-sqlite.py')); const outlineData = await app.workbench.positronOutline.getOutlineData(); const expected = [ 'data_file_pathdata_file_path = os.path.join(os.getcwd(), \'data-files\', \'chinook\', \'chinook.db\')', @@ -33,7 +33,7 @@ test.describe('Outline #web #win', { }); test('R - Verify Outline Contents [C956871]', async function ({ app, r }) { - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'chinook-db-r', 'chinook-sqlite.r')); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'chinook-db-r', 'chinook-sqlite.r')); const outlineData = await app.workbench.positronOutline.getOutlineData(); const expected = [ 'con', diff --git a/test/e2e/areas/plots/matplotlib-interact.test.ts b/test/e2e/areas/plots/matplotlib-interact.test.ts index 1f5931d7cee..c07c7fa78e4 100644 --- a/test/e2e/areas/plots/matplotlib-interact.test.ts +++ b/test/e2e/areas/plots/matplotlib-interact.test.ts @@ -25,7 +25,7 @@ test.describe('Matplotlib Interact', { tag: [tags.PLOTS, tags.NOTEBOOK] }, () => await notebooks.runAllCells(); - await app.workbench.quickaccess.runCommand('workbench.action.togglePanel'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.togglePanel'); const plotLocator = app.workbench.positronNotebooks.frameLocator.locator('.widget-output'); diff --git a/test/e2e/areas/plots/plots.test.ts b/test/e2e/areas/plots/plots.test.ts index d20ac926576..e65f158b0ff 100644 --- a/test/e2e/areas/plots/plots.test.ts +++ b/test/e2e/areas/plots/plots.test.ts @@ -70,7 +70,7 @@ test.describe('Plots', { tag: [tags.PLOTS, tags.EDITOR] }, () => { await test.step('Verify plot can be opened in editor', async () => { await app.workbench.positronPlots.openPlotInEditor(); await app.workbench.positronPlots.waitForPlotInEditor(); - await app.workbench.quickaccess.runCommand('workbench.action.closeAllEditors'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.closeAllEditors'); }); await app.workbench.positronLayouts.enterLayout('fullSizedAuxBar'); @@ -98,7 +98,7 @@ test.describe('Plots', { tag: [tags.PLOTS, tags.EDITOR] }, () => { await test.step('Verify plot can be opened in editor', async () => { await app.workbench.positronPlots.openPlotInEditor(); await app.workbench.positronPlots.waitForPlotInEditor(); - await app.workbench.quickaccess.runCommand('workbench.action.closeAllEditors'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.closeAllEditors'); }); }); @@ -297,7 +297,7 @@ test.describe('Plots', { tag: [tags.PLOTS, tags.EDITOR] }, () => { await test.step('Verify plot can be opened in editor', async () => { await app.workbench.positronPlots.openPlotInEditor(); await app.workbench.positronPlots.waitForPlotInEditor(); - await app.workbench.quickaccess.runCommand('workbench.action.closeAllEditors'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.closeAllEditors'); }); await app.workbench.positronLayouts.enterLayout('fullSizedAuxBar'); diff --git a/test/e2e/areas/quarto/quarto.test.ts b/test/e2e/areas/quarto/quarto.test.ts index 9b78ac46105..eaf7f989535 100644 --- a/test/e2e/areas/quarto/quarto.test.ts +++ b/test/e2e/areas/quarto/quarto.test.ts @@ -16,7 +16,7 @@ test.use({ test.describe('Quarto', { tag: [tags.WEB, tags.QUARTO] }, () => { test.beforeAll(async function ({ app, browserName }) { - await app.workbench.quickaccess.openFile(path.join(app.workspacePathOrFolder, 'workspaces', 'quarto_basic', 'quarto_basic.qmd')); + await app.workbench.positronQuickaccess.openFile(path.join(app.workspacePathOrFolder, 'workspaces', 'quarto_basic', 'quarto_basic.qmd')); isWeb = browserName === 'chromium'; }); @@ -45,7 +45,7 @@ test.describe('Quarto', { tag: [tags.WEB, tags.QUARTO] }, () => { }); test('should be able to generate preview [C842891]', async function ({ app }) { - await app.workbench.quickaccess.runCommand('quarto.preview', { keepOpen: true }); + await app.workbench.positronQuickaccess.runCommand('quarto.preview', { keepOpen: true }); const viewerFrame = app.workbench.positronViewer.getViewerFrame().frameLocator('iframe'); // verify preview displays @@ -56,7 +56,7 @@ test.describe('Quarto', { tag: [tags.WEB, tags.QUARTO] }, () => { const renderQuartoDocument = async (app: Application, fileExtension: string) => { await test.step(`render quarto document`, async () => { - await app.workbench.quickaccess.runCommand('quarto.render.document', { keepOpen: true }); + await app.workbench.positronQuickaccess.runCommand('quarto.render.document', { keepOpen: true }); await app.workbench.positronQuickInput.selectQuickInputElementContaining(fileExtension); }); }; diff --git a/test/e2e/areas/r-markdown/r-markdown.test.ts b/test/e2e/areas/r-markdown/r-markdown.test.ts index cc38a95bad1..7e8b3d28b29 100644 --- a/test/e2e/areas/r-markdown/r-markdown.test.ts +++ b/test/e2e/areas/r-markdown/r-markdown.test.ts @@ -12,12 +12,12 @@ test.use({ test.describe('R Markdown', { tag: [tags.WEB, tags.R_MARKDOWN] }, () => { test('Render R Markdown [C680618]', async function ({ app, r }) { - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'basic-rmd-file', 'basicRmd.rmd')); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'basic-rmd-file', 'basicRmd.rmd')); // Sometimes running render too quickly fails, saying pandoc is not installed. // Using expect.toPass allows it to retry. await expect(async () => { - await app.workbench.quickaccess.runCommand('r.rmarkdownRender'); + await app.workbench.positronQuickaccess.runCommand('r.rmarkdownRender'); await app.workbench.terminal.waitForTerminalText(buffer => buffer.some(line => line.startsWith('Output created: basicRmd.html'))); }).toPass({ timeout: 80000 }); diff --git a/test/e2e/areas/r-pkg-development/r-pkg-development.test.ts b/test/e2e/areas/r-pkg-development/r-pkg-development.test.ts index 0bd59823222..85f13d78711 100644 --- a/test/e2e/areas/r-pkg-development/r-pkg-development.test.ts +++ b/test/e2e/areas/r-pkg-development/r-pkg-development.test.ts @@ -15,9 +15,9 @@ test.describe('R Package Development', { tag: [tags.WEB, tags.R_PKG_DEVELOPMENT] try { // don't use native file picker await userSettings.set([['files.simpleDialog.enable', 'true']]); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); await app.workbench.positronConsole.barClearButton.click(); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); } catch (e) { app.code.driver.takeScreenshot('rPackageSetup'); throw e; @@ -30,7 +30,7 @@ test.describe('R Package Development', { tag: [tags.WEB, tags.R_PKG_DEVELOPMENT] await test.step('Open R Package', async () => { // Navigate to https://github.com/posit-dev/qa-example-content/tree/main/workspaces/r_testing // This is an R package embedded in qa-example-content - await app.workbench.quickaccess.runCommand('workbench.action.files.openFolder', { keepOpen: true }); + await app.workbench.positronQuickaccess.runCommand('workbench.action.files.openFolder', { keepOpen: true }); await app.workbench.positronQuickInput.waitForQuickInputOpened(); await app.workbench.positronQuickInput.type(path.join(app.workspacePathOrFolder, 'workspaces', 'r_testing')); await app.workbench.positronQuickInput.clickOkOnQuickInput(); @@ -41,7 +41,7 @@ test.describe('R Package Development', { tag: [tags.WEB, tags.R_PKG_DEVELOPMENT] await test.step('Test R Package', async () => { logger.log('Test R Package'); - await app.workbench.quickaccess.runCommand('r.packageTest'); + await app.workbench.positronQuickaccess.runCommand('r.packageTest'); await expect(async () => { await app.workbench.terminal.waitForTerminalText(buffer => buffer.some(line => line.startsWith('[ FAIL 1 | WARN 0 | SKIP 0 | PASS 16 ]'))); await app.workbench.terminal.waitForTerminalText(buffer => buffer.some(line => line.includes('Terminal will be reused by tasks'))); @@ -50,8 +50,8 @@ test.describe('R Package Development', { tag: [tags.WEB, tags.R_PKG_DEVELOPMENT] await test.step('Check R Package', async () => { logger.log('Check R Package'); - await app.workbench.quickaccess.runCommand('workbench.action.terminal.clear'); - await app.workbench.quickaccess.runCommand('r.packageCheck'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.terminal.clear'); + await app.workbench.positronQuickaccess.runCommand('r.packageCheck'); await expect(async () => { await app.workbench.terminal.waitForTerminalText(buffer => buffer.some(line => line.startsWith('Error: R CMD check found ERRORs'))); await app.workbench.terminal.waitForTerminalText(buffer => buffer.some(line => line.includes('Terminal will be reused by tasks'))); @@ -60,7 +60,7 @@ test.describe('R Package Development', { tag: [tags.WEB, tags.R_PKG_DEVELOPMENT] await test.step('Install R Package and Restart R', async () => { logger.log('Install R Package and Restart R'); - await app.workbench.quickaccess.runCommand('r.packageInstall'); + await app.workbench.positronQuickaccess.runCommand('r.packageInstall'); await app.workbench.terminal.waitForTerminalText(buffer => buffer.some(line => line.startsWith('✔ Installed testfun 0.0.0.9000'))); await app.workbench.positronConsole.waitForConsoleContents('restarted', { timeout: 30000 }); diff --git a/test/e2e/areas/test-explorer/test-explorer.test.ts b/test/e2e/areas/test-explorer/test-explorer.test.ts index 56537568243..5dce7074fd1 100644 --- a/test/e2e/areas/test-explorer/test-explorer.test.ts +++ b/test/e2e/areas/test-explorer/test-explorer.test.ts @@ -19,9 +19,9 @@ test.describe('Test Explorer', { tag: [tags.TEST_EXPLORER] }, () => { 'true', ]]); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); await app.workbench.positronConsole.barClearButton.click(); - await app.workbench.quickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); + await app.workbench.positronQuickaccess.runCommand('workbench.action.toggleAuxiliaryBar'); } catch (e) { app.code.driver.takeScreenshot('testExplorerSetup'); throw e; @@ -32,7 +32,7 @@ test.describe('Test Explorer', { tag: [tags.TEST_EXPLORER] }, () => { await expect(async () => { // Navigate to https://github.com/posit-dev/qa-example-content/tree/main/workspaces/r_testing // This is an R package embedded in qa-example-content - await app.workbench.quickaccess.runCommand('workbench.action.files.openFolder', { keepOpen: true }); + await app.workbench.positronQuickaccess.runCommand('workbench.action.files.openFolder', { keepOpen: true }); await app.workbench.positronQuickInput.waitForQuickInputOpened(); await app.workbench.positronQuickInput.type(path.join(app.workspacePathOrFolder, 'workspaces', 'r_testing')); // Had to add a positron class, because Microsoft did not have this: diff --git a/test/e2e/areas/top-action-bar/top-action-bar-save.test.ts b/test/e2e/areas/top-action-bar/top-action-bar-save.test.ts index 18c5db8fbd9..41c01e732ec 100644 --- a/test/e2e/areas/top-action-bar/top-action-bar-save.test.ts +++ b/test/e2e/areas/top-action-bar/top-action-bar-save.test.ts @@ -21,7 +21,7 @@ test.describe('Top Action Bar - Save Actions', { }); test('Save and Save All both disabled when no unsaved editors are open [C656253]', async function ({ app }) { - await app.workbench.quickaccess.runCommand('workbench.action.closeAllEditors', { keepOpen: false }); + await app.workbench.positronQuickaccess.runCommand('workbench.action.closeAllEditors', { keepOpen: false }); await expect(async () => { expect(await app.workbench.positronTopActionBar.saveButton.isDisabled()).toBeTruthy(); expect(await app.workbench.positronTopActionBar.saveAllButton.isDisabled()).toBeTruthy(); @@ -30,9 +30,9 @@ test.describe('Top Action Bar - Save Actions', { test('Save enabled and Save All disabled when a single unsaved file is open [C656254]', async function ({ app }) { const fileName = 'README.md'; - await app.workbench.quickaccess.runCommand('workbench.action.closeAllEditors', { keepOpen: false }); - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, fileName)); - await app.workbench.quickaccess.runCommand('workbench.action.keepEditor', { keepOpen: false }); + await app.workbench.positronQuickaccess.runCommand('workbench.action.closeAllEditors', { keepOpen: false }); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, fileName)); + await app.workbench.positronQuickaccess.runCommand('workbench.action.keepEditor', { keepOpen: false }); await app.workbench.editors.selectTab(fileName); await app.workbench.editor.waitForTypeInEditor(fileName, 'Puppies frolicking in a meadow of wildflowers'); // The file is now "dirty" and the save buttons should be enabled @@ -57,11 +57,11 @@ test.describe('Top Action Bar - Save Actions', { const fileName2 = 'DESCRIPTION'; const text = 'Kittens playing with yarn'; // Open two files and type in some text - await app.workbench.quickaccess.runCommand('workbench.action.closeAllEditors', { keepOpen: false }); - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, fileName1)); - await app.workbench.quickaccess.runCommand('workbench.action.keepEditor', { keepOpen: false }); - await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, fileName2)); - await app.workbench.quickaccess.runCommand('workbench.action.keepEditor', { keepOpen: false }); + await app.workbench.positronQuickaccess.runCommand('workbench.action.closeAllEditors', { keepOpen: false }); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, fileName1)); + await app.workbench.positronQuickaccess.runCommand('workbench.action.keepEditor', { keepOpen: false }); + await app.workbench.positronQuickaccess.openFile(join(app.workspacePathOrFolder, fileName2)); + await app.workbench.positronQuickaccess.runCommand('workbench.action.keepEditor', { keepOpen: false }); await app.workbench.editors.selectTab(fileName1); await app.workbench.editor.waitForTypeInEditor(fileName1, text); await app.workbench.editors.selectTab(fileName2); @@ -89,8 +89,8 @@ test.describe('Top Action Bar - Save Actions', { const fileName = 'Untitled-1'; const text = 'Bunnies hopping through a field of clover'; // Open a new file and type in some text - await app.workbench.quickaccess.runCommand('workbench.action.closeAllEditors', { keepOpen: false }); - await app.workbench.quickaccess.runCommand('workbench.action.files.newUntitledFile', { keepOpen: false }); + await app.workbench.positronQuickaccess.runCommand('workbench.action.closeAllEditors', { keepOpen: false }); + await app.workbench.positronQuickaccess.runCommand('workbench.action.files.newUntitledFile', { keepOpen: false }); await app.workbench.editors.selectTab(fileName); await app.workbench.editor.waitForTypeInEditor(fileName, text); // The file is now "dirty" and the save buttons should be enabled diff --git a/test/e2e/areas/variables/variables-expanded.test.ts b/test/e2e/areas/variables/variables-expanded.test.ts index f860d5e8ada..e57ce885279 100644 --- a/test/e2e/areas/variables/variables-expanded.test.ts +++ b/test/e2e/areas/variables/variables-expanded.test.ts @@ -13,6 +13,7 @@ test.describe('Variables - Expanded View', { tag: [tags.WEB, tags.VARIABLES] }, test.afterEach(async function ({ app }) { await app.workbench.positronLayouts.enterLayout('stacked'); + await app.workbench.positronConsole.barClearButton.click(); await app.workbench.positronConsole.barRestartButton.click(); }); diff --git a/test/e2e/areas/welcome/welcome.test.ts b/test/e2e/areas/welcome/welcome.test.ts index a66b26f9f95..35e5a9e8fc7 100644 --- a/test/e2e/areas/welcome/welcome.test.ts +++ b/test/e2e/areas/welcome/welcome.test.ts @@ -11,11 +11,11 @@ test.use({ test.describe('Welcome Page', { tag: [tags.WELCOME] }, () => { test.beforeEach(async function ({ app }) { - await app.workbench.quickaccess.runCommand('Help: Welcome'); + await app.workbench.positronQuickaccess.runCommand('Help: Welcome'); }); test.afterEach(async function ({ app }) { - await app.workbench.quickaccess.runCommand('View: Close All Editors'); + await app.workbench.positronQuickaccess.runCommand('View: Close All Editors'); }); test.describe('General', () => { @@ -46,7 +46,7 @@ test.describe('Welcome Page', { tag: [tags.WELCOME] }, () => { await expect(app.workbench.positronWelcome.openButtons).toHaveText(OPEN_BUTTONS_LABELS); - await app.workbench.quickaccess.runCommand('File: Clear Recently Opened...'); + await app.workbench.positronQuickaccess.runCommand('File: Clear Recently Opened...'); await expect(app.workbench.positronWelcome.recentTitle).toHaveText('Recent'); @@ -76,7 +76,7 @@ test.describe('Welcome Page', { tag: [tags.WELCOME] }, () => { await expect(app.workbench.editors.activeEditor.locator(app.workbench.editors.editorIcon)).toHaveClass(/python-lang-file-icon/); - await app.workbench.quickaccess.runCommand('View: Close Editor'); + await app.workbench.positronQuickaccess.runCommand('View: Close Editor'); }); test('Create a new Python notebook from the Welcome page [C684753]', async function ({ app, python }) {