mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-04 15:25:47 +01:00
Enable edit context (#237497)
* Revert "Revert Enablement of EditContext on Insiders (#235062)"
This reverts commit 45385e1c6f.
* adding product import
* adding som code
* removing console logs
* make sure editor selection is observed after keybinding dispatches
Co-authored-with: Aiday Mar <amarlenkyzy@microsoft.com>
* removing empty lines
---------
Co-authored-by: João Moreno <joao.moreno@microsoft.com>
This commit is contained in:
committed by
GitHub
parent
964233731a
commit
3ff1dceedf
@@ -12,6 +12,7 @@ import { launch as launchPlaywrightBrowser } from './playwrightBrowser';
|
||||
import { PlaywrightDriver } from './playwrightDriver';
|
||||
import { launch as launchPlaywrightElectron } from './playwrightElectron';
|
||||
import { teardown } from './processes';
|
||||
import { Quality } from './application';
|
||||
|
||||
export interface LaunchOptions {
|
||||
codePath?: string;
|
||||
@@ -28,6 +29,7 @@ export interface LaunchOptions {
|
||||
readonly tracing?: boolean;
|
||||
readonly headless?: boolean;
|
||||
readonly browser?: 'chromium' | 'webkit' | 'firefox';
|
||||
readonly quality: Quality;
|
||||
}
|
||||
|
||||
interface ICodeInstance {
|
||||
@@ -77,7 +79,7 @@ export async function launch(options: LaunchOptions): Promise<Code> {
|
||||
const { serverProcess, driver } = await measureAndLog(() => launchPlaywrightBrowser(options), 'launch playwright (browser)', options.logger);
|
||||
registerInstance(serverProcess, options.logger, 'server');
|
||||
|
||||
return new Code(driver, options.logger, serverProcess);
|
||||
return new Code(driver, options.logger, serverProcess, options.quality);
|
||||
}
|
||||
|
||||
// Electron smoke tests (playwright)
|
||||
@@ -85,7 +87,7 @@ export async function launch(options: LaunchOptions): Promise<Code> {
|
||||
const { electronProcess, driver } = await measureAndLog(() => launchPlaywrightElectron(options), 'launch playwright (electron)', options.logger);
|
||||
registerInstance(electronProcess, options.logger, 'electron');
|
||||
|
||||
return new Code(driver, options.logger, electronProcess);
|
||||
return new Code(driver, options.logger, electronProcess, options.quality);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +98,8 @@ export class Code {
|
||||
constructor(
|
||||
driver: PlaywrightDriver,
|
||||
readonly logger: Logger,
|
||||
private readonly mainProcess: cp.ChildProcess
|
||||
private readonly mainProcess: cp.ChildProcess,
|
||||
readonly quality: Quality
|
||||
) {
|
||||
this.driver = new Proxy(driver, {
|
||||
get(target, prop) {
|
||||
@@ -242,6 +245,10 @@ export class Code {
|
||||
await this.poll(() => this.driver.typeInEditor(selector, text), () => true, `type in editor '${selector}'`);
|
||||
}
|
||||
|
||||
async waitForEditorSelection(selector: string, accept: (selection: { selectionStart: number; selectionEnd: number }) => boolean): Promise<void> {
|
||||
await this.poll(() => this.driver.getEditorSelection(selector), accept, `get editor selection '${selector}'`);
|
||||
}
|
||||
|
||||
async waitForTerminalBuffer(selector: string, accept: (result: string[]) => boolean): Promise<void> {
|
||||
await this.poll(() => this.driver.getTerminalBuffer(selector), accept, `get terminal buffer '${selector}'`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user