From c65c8738f96abd0262e561b67dbe5d58dc4d5047 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Fri, 12 Nov 2021 06:11:18 -0800 Subject: [PATCH] Copy and use IWindowDriver in PlaywrightDriver --- .eslintrc.json | 1 - src/vs/platform/driver/common/driver.ts | 8 ++++---- test/automation/src/playwrightDriver.ts | 19 +------------------ 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 08f5bfd644b..70012db4e74 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -952,7 +952,6 @@ "@vscode/*", "@parcel/*", "playwright-core/**", - "**/vs/platform/driver/common/**", "*" // node modules ] }, diff --git a/src/vs/platform/driver/common/driver.ts b/src/vs/platform/driver/common/driver.ts index e447cee2532..41b7809f448 100644 --- a/src/vs/platform/driver/common/driver.ts +++ b/src/vs/platform/driver/common/driver.ts @@ -57,10 +57,6 @@ export interface IDriver { getLocaleInfo(windowId: number): Promise; getLocalizedStrings(windowId: number): Promise; } -//*END - -export const ID = 'driverService'; -export const IDriver = createDecorator(ID); export interface IWindowDriver { click(selector: string, xoffset?: number | undefined, yoffset?: number | undefined): Promise; @@ -76,6 +72,10 @@ export interface IWindowDriver { getLocaleInfo(): Promise; getLocalizedStrings(): Promise } +//*END + +export const ID = 'driverService'; +export const IDriver = createDecorator(ID); export interface IDriverOptions { verbose: boolean; diff --git a/test/automation/src/playwrightDriver.ts b/test/automation/src/playwrightDriver.ts index e406b740f85..4ea07cb4cc4 100644 --- a/test/automation/src/playwrightDriver.ts +++ b/test/automation/src/playwrightDriver.ts @@ -8,27 +8,10 @@ import { ChildProcess, spawn } from 'child_process'; import { join } from 'path'; import { mkdir } from 'fs'; import { promisify } from 'util'; -import { IDriver, IDisposable } from './driver'; +import { IDriver, IDisposable, IWindowDriver } from './driver'; import { URI } from 'vscode-uri'; import * as kill from 'tree-kill'; import { PageFunction } from 'playwright-core/types/structs'; -import { IElement, ILocaleInfo, ILocalizedStrings } from '.'; - -// TODO: Copy driver over to ./driver.d.ts? -export interface IWindowDriver { - click(selector: string, xoffset?: number | undefined, yoffset?: number | undefined): Promise; - doubleClick(selector: string): Promise; - setValue(selector: string, text: string): Promise; - getTitle(): Promise; - isActiveElement(selector: string): Promise; - getElements(selector: string, recursive: boolean): Promise; - getElementXY(selector: string, xoffset?: number, yoffset?: number): Promise<{ x: number; y: number; }>; - typeInEditor(selector: string, text: string): Promise; - getTerminalBuffer(selector: string): Promise; - writeInTerminal(selector: string, text: string): Promise; - getLocaleInfo(): Promise; - getLocalizedStrings(): Promise -} const width = 1200; const height = 800;