Skip to content

Commit

Permalink
E2E test: ensure mikhail-arkhipov.r cannot be installed (#6411)
Browse files Browse the repository at this point in the history
Ensure mikhail-arkhipov.r cannot be installed as it conflicts with
Positron.

### QA Notes

All tests pass

@:web @:extensions
  • Loading branch information
testlabauto authored Feb 20, 2025
1 parent d0e35ac commit 97c6800
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/vs/workbench/services/dialogs/common/dialogService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export class DialogService extends Disposable implements IDialogService {
return true; // integration tests
}

return !!this.environmentService.enableSmokeTestDriver; // smoke tests
// --- Start Positron ---
return false;
// --- End Positron ---
}

async confirm(confirmation: IConfirmation): Promise<IConfirmationResult> {
Expand Down
1 change: 1 addition & 0 deletions test/e2e/infra/test-runner/test-tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export enum TestTags {
DEBUG = '@:debug',
DUCK_DB = '@:duck-db',
EDITOR_ACTION_BAR = '@:editor-action-bar',
EXTENSIONS = '@:extensions',
HELP = '@:help',
HTML = '@:html',
INTERPRETER = '@:interpreter',
Expand Down
10 changes: 6 additions & 4 deletions test/e2e/pages/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@ export class Extensions {
}
}

async installExtension(id: string, waitUntilEnabled: boolean): Promise<void> {
async installExtension(id: string, waitUntilEnabled: boolean, attemptInstallOnly: boolean = false): Promise<void> {
await this.searchForExtension(id);
const locator = this.code.driver.page.locator(`div.extensions-viewlet[id="workbench.view.extensions"] .monaco-list-row[data-extension-id="${id}"] .extension-list-item .monaco-action-bar .action-item:not(.disabled) .extension-action.install`).first();
await expect(locator).toBeVisible();
await locator.click();
await expect(this.code.driver.page.locator(`.extension-editor .monaco-action-bar .action-item:not(.disabled) .extension-action.uninstall`).first()).toBeVisible();
if (waitUntilEnabled) {
await expect(this.code.driver.page.locator(`.extension-editor .monaco-action-bar .action-item:not(.disabled) a[aria-label="Disable this extension"]`)).toBeVisible();
if (!attemptInstallOnly) {
await expect(this.code.driver.page.locator(`.extension-editor .monaco-action-bar .action-item:not(.disabled) .extension-action.uninstall`).first()).toBeVisible();
if (waitUntilEnabled) {
await expect(this.code.driver.page.locator(`.extension-editor .monaco-action-bar .action-item:not(.disabled) a[aria-label="Disable this extension"]`)).toBeVisible();
}
}
}

Expand Down
28 changes: 28 additions & 0 deletions test/e2e/tests/extensions/blocked-installs.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*---------------------------------------------------------------------------------------------
* Copyright (C) 2025 Posit Software, PBC. All rights reserved.
* Licensed under the Elastic License 2.0. See LICENSE.txt for license information.
*--------------------------------------------------------------------------------------------*/

import { expect } from '@playwright/test';
import { test, tags } from '../_test.setup';

test.use({
suiteId: __filename
});


test.describe('Extensions', {
tag: [tags.EXTENSIONS, tags.WEB],
}, () => {

test('Verify block of R extension installation', {
tag: [tags.WEB_ONLY]
}, async function ({ app }) {

await app.workbench.extensions.installExtension('mikhail-arkhipov.r', false, true);

expect(app.code.driver.page.getByText('Cannot install the \'R Tools\' extension')).toBeVisible();

});
});

0 comments on commit 97c6800

Please sign in to comment.