Skip to content

Commit

Permalink
make tests work with v1.73
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Nov 14, 2022
1 parent e815268 commit 604f71a
Show file tree
Hide file tree
Showing 45 changed files with 245 additions and 227 deletions.
20 changes: 12 additions & 8 deletions src/launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ export default class VSCodeServiceLauncher extends ChromedriverServiceLauncher {
* setup VSCode Web
*/
await this._setupVSCodeWeb(version, cap)
this._mapBrowserCapabilities()
// @ts-expect-error CJS
const instance = await instance
this._mapBrowserCapabilities(instance.options as ServiceOptions)
}

return super.onPrepare()
Expand Down Expand Up @@ -147,6 +149,8 @@ export default class VSCodeServiceLauncher extends ChromedriverServiceLauncher {
throw new Error(`No key "${VSCODE_CAPABILITY_KEY}" found in caps`)
}

// @ts-expect-error CJS
const instance = await this.instance
if (versionsFileExist) {
const content = JSON.parse((await fs.readFile(versionsFilePath)).toString()) as Versions
const chromedriverPath = path.join(this._cachePath, `chromedriver-${content[version]?.chromedriver}`)
Expand All @@ -161,26 +165,26 @@ export default class VSCodeServiceLauncher extends ChromedriverServiceLauncher {
+ `and Chromedriver v${content[version]?.chromedriver} already exist`
)

Object.assign(cap, this.options)
Object.assign(cap, instance.options)
cap[VSCODE_CAPABILITY_KEY].binary = (
cap[VSCODE_CAPABILITY_KEY].binary
|| await this._downloadVSCode(content[version]?.vscode as string)
)
this.chromedriverCustomPath = chromedriverPath
instance.chromedriverCustomPath = chromedriverPath
return
}
}

const [vscodeVersion, chromedriverVersion, chromedriverPath] = await this._setupChromedriver(version)
this.chromedriverCustomPath = chromedriverPath
instance.chromedriverCustomPath = chromedriverPath
const serviceArgs: ServiceCapability = {
chromedriver: { version: chromedriverVersion, path: chromedriverPath },
vscode: {
version: vscodeVersion,
path: cap[VSCODE_CAPABILITY_KEY]?.binary || await this._downloadVSCode(vscodeVersion)
}
}
Object.assign(cap, this.options)
Object.assign(cap, instance.options)
cap[VSCODE_CAPABILITY_KEY].binary = serviceArgs.vscode.path
await this._updateVersionsTxt(version, serviceArgs, versionsFileExist)
}
Expand Down Expand Up @@ -349,14 +353,14 @@ export default class VSCodeServiceLauncher extends ChromedriverServiceLauncher {
)
}

private _mapBrowserCapabilities () {
if (isMultiremote(this.capabilities)) {
private _mapBrowserCapabilities (options: ServiceOptions) {
if (isMultiremote(this._capabilities)) {
throw new SevereServiceError('This service deson\'t support multiremote yet')
}

for (const cap of this._capabilities as any as Capabilities.Capabilities[]) {
if (isChrome(cap)) {
Object.assign(cap, this.options)
Object.assign(cap, options)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/locators/1.67.0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from './1.66.0'

export * from './1.66.0'
export const locatorVersion = '1.70.0'
export const locatorVersion = '1.73.0'
export const BottomBarPanel = {
...BottomBarPanelImport,
action: (label: string) => `.//li[starts-with(@title, '${label}')]`
Expand Down
10 changes: 10 additions & 0 deletions src/locators/1.73.0.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {
BottomBarViews as BottomBarViewsImport
} from './1.70.0'

export * from './1.70.0'
export const locatorVersion = '1.73.0'
export const BottomBarViews = {
...BottomBarViewsImport,
outputChannels: 'select[title="Tasks"]'
}
4 changes: 2 additions & 2 deletions src/locators/insiders.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
QuickOpenBox as QuickOpenBoxImport
} from './1.70.0'
} from './1.73.0'

export * from './1.70.0'
export * from './1.73.0'
export const locatorVersion = 'insiders'
export const QuickOpenBox = {
...QuickOpenBoxImport,
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/activityBar/ActionsControl.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ElementWithContextMenu } from '../utils'
import { ActivityBar as ActivityBarLocators } from '../../locators/1.70.0'
import { ActivityBar as ActivityBarLocators } from '../../locators/1.73.0'
import type { ContextMenu } from '../menu/ContextMenu'

/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/activityBar/ActivityBar.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ViewControl, ActionsControl } from '..'
import { PageDecorator, IPageDecorator, ElementWithContextMenu } from '../utils'
import { ActivityBar as ActivityBarLocators } from '../../locators/1.70.0'
import { ActivityBar as ActivityBarLocators } from '../../locators/1.73.0'

export interface ActivityBar extends IPageDecorator<typeof ActivityBarLocators> {}
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/activityBar/ViewControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { NewScmView } from '../sidebar/scm/NewScmView'
import {
PageDecorator, IPageDecorator, ElementWithContextMenu, VSCodeLocatorMap
} from '../utils'
import { ViewControl as ViewControlLocators } from '../../locators/1.70.0'
import { ViewControl as ViewControlLocators } from '../../locators/1.73.0'

export interface ViewControl extends IPageDecorator<typeof ViewControlLocators> { }
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/bottomBar/BottomBarPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
StatusBar
} from '..'
import { BasePage, PageDecorator, IPageDecorator } from '../utils'
import { BottomBarPanel as BottomBarPanelLocators } from '../../locators/1.70.0'
import { BottomBarPanel as BottomBarPanelLocators } from '../../locators/1.73.0'

export interface BottomBarPanel extends IPageDecorator<typeof BottomBarPanelLocators> {}
/**
Expand Down
6 changes: 3 additions & 3 deletions src/pageobjects/bottomBar/ProblemsView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { BottomBarPanel } from '..'
import {
BasePage, ElementWithContextMenu, PageDecorator, IPageDecorator, VSCodeLocatorMap
} from '../utils'
import { ProblemsView as ProblemsViewLocators, Marker as MarkerLocators } from '../../locators/1.70.0'
import { ProblemsView as ProblemsViewLocators, Marker as MarkerLocators } from '../../locators/1.73.0'

export interface ProblemsView extends IPageDecorator<typeof ProblemsViewLocators> {}
/**
Expand Down Expand Up @@ -70,8 +70,8 @@ export class ProblemsView extends BasePage<typeof ProblemsViewLocators> {
/**
* @deprecated The method should not be used and getAllVisibleMarkers() should be used instead.
*/
async getAllMarkers (type: MarkerType): Promise<Marker[]> {
return this.getAllVisibleMarkers(type)
async getAllMarkers (): Promise<Marker[]> {
return this.getAllVisibleMarkers(MarkerType.Any)
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/bottomBar/Views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
OutputView as OutputViewLocators,
DebugConsoleView as DebugConsoleViewLocators,
TerminalView as TerminalViewLocators
} from '../../locators/1.70.0'
} from '../../locators/1.73.0'

export interface OutputView extends IPageDecorator<typeof OutputViewLocators> {}
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/dialog/ModalDialog.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PageDecorator, IPageDecorator, BasePage } from '../utils'
import { Dialog as DialogLocators } from '../../locators/1.70.0'
import { Dialog as DialogLocators } from '../../locators/1.73.0'

export interface ModalDialog extends IPageDecorator<typeof DialogLocators> {}
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/editor/ContentAssist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
import {
PageDecorator, IPageDecorator, VSCodeLocatorMap, sleep
} from '../utils'
import { ContentAssist as ContentAssistLocators } from '../../locators/1.70.0'
import { ContentAssist as ContentAssistLocators } from '../../locators/1.73.0'

export interface ContentAssist extends IPageDecorator<typeof ContentAssistLocators> {}
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/editor/CustomEditor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Editor, InputBox } from '..'
import { PageDecorator, IPageDecorator } from '../utils'
import { Editor as EditorLocators } from '../../locators/1.70.0'
import { Editor as EditorLocators } from '../../locators/1.73.0'
import { CMD_KEY } from '../../constants'

export interface CustomEditor extends IPageDecorator<typeof EditorLocators> {}
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/editor/DiffEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Editor, EditorLocators } from './Editor'
import { TextEditor } from './TextEditor'
import { EditorView } from './EditorView'
import { PageDecorator, IPageDecorator } from '../utils'
import { DiffEditor as DiffEditorLocators } from '../../locators/1.70.0'
import { DiffEditor as DiffEditorLocators } from '../../locators/1.73.0'

export interface DiffEditor extends IPageDecorator<EditorLocators> {}
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/editor/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
TextEditor as TextEditorLocators,
DiffEditor as DiffEditorLocators,
EditorView as EditorViewLocators
} from '../../locators/1.70.0'
} from '../../locators/1.73.0'

/**
* @hidden
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/editor/EditorView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import {
EditorView as EditorViewLocators,
Editor as EditorLocatorsObj
} from '../../locators/1.70.0'
} from '../../locators/1.73.0'

export interface EditorView extends IPageDecorator<typeof EditorViewLocators> {}
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/editor/SettingsEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { EditorView, EditorGroup } from '..'
import {
PageDecorator, IPageDecorator, BasePage, VSCodeLocatorMap, sleep
} from '../utils'
import { SettingsEditor as SettingsEditorLocators } from '../../locators/1.70.0'
import { SettingsEditor as SettingsEditorLocators } from '../../locators/1.73.0'

export interface SettingsEditor extends IPageDecorator<EditorLocators> {}
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/editor/TextEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import {
TextEditor as TextEditorLocators,
FindWidget as FindWidgetLocators
} from '../../locators/1.70.0'
} from '../../locators/1.73.0'
import { CMD_KEY } from '../../constants'

export interface TextEditor extends IPageDecorator<EditorLocators> {}
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/menu/ContextMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Menu, MenuItem } from '..'
import {
PageDecorator, IPageDecorator, VSCodeLocatorMap, sleep
} from '../utils'
import { ContextMenu as ContextMenuLocators } from '../../locators/1.70.0'
import { ContextMenu as ContextMenuLocators } from '../../locators/1.73.0'

export interface ContextMenu extends IPageDecorator<typeof ContextMenuLocators> {}
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/menu/TitleBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { PageDecorator, IPageDecorator, VSCodeLocatorMap } from '../utils'
import { WindowControls, ContextMenu } from '..'
import { Menu } from './Menu'
import { MenuItem } from './MenuItem'
import { TitleBar as TitleBarLocators } from '../../locators/1.70.0'
import { TitleBar as TitleBarLocators } from '../../locators/1.73.0'

export interface TitleBar extends IPageDecorator<typeof TitleBarLocators> {}
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/menu/WindowControls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
PageDecorator, IPageDecorator, BasePage, VSCodeLocatorMap
} from '../utils'
import { TitleBar } from '../..'
import { WindowControls as WindowControlsLocators } from '../../locators/1.70.0'
import { WindowControls as WindowControlsLocators } from '../../locators/1.73.0'

export interface WindowControls extends IPageDecorator<typeof WindowControlsLocators> {}
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/sidebar/SideBarView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ViewContent, ViewTitlePart } from '..'
import {
PageDecorator, IPageDecorator, BasePage, LocatorComponents
} from '../utils'
import { SideBarView as SideBarViewLocators } from '../../locators/1.70.0'
import { SideBarView as SideBarViewLocators } from '../../locators/1.73.0'

export interface SideBarView<T> extends IPageDecorator<typeof SideBarViewLocators> { }
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/sidebar/ViewContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ExtensionsViewSection } from './extensions/ExtensionsViewSection'
import {
PageDecorator, IPageDecorator, BasePage, VSCodeLocatorMap
} from '../utils'
import { ViewContent as ViewContentLocators } from '../../locators/1.70.0'
import { ViewContent as ViewContentLocators } from '../../locators/1.73.0'

export interface ViewContent extends IPageDecorator<typeof ViewContentLocators> { }
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/sidebar/ViewItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
CustomTreeItem as CustomTreeItemLocators,
DefaultTreeItem as DefaultTreeItemLocators,
ExtensionsViewItem as ExtensionsViewItemLocators
} from '../../locators/1.70.0'
} from '../../locators/1.73.0'

/**
* Abstract representation of a row in the tree inside a view content section
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/sidebar/ViewSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
ExtensionsViewSection as ExtensionsViewSectionLocators,
CustomTreeSection as CustomTreeSectionLocators,
DefaultTreeSection as DefaultTreeSectionLocators
} from '../../locators/1.70.0'
} from '../../locators/1.73.0'

/**
* @hidden
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/sidebar/ViewTitlePart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
ElementWithContextMenu, PageDecorator, IPageDecorator, BasePage, VSCodeLocatorMap
} from '../utils'
import { SideBarView } from '..'
import { ViewTitlePart as ViewTitlePartLocators } from '../../locators/1.70.0'
import { ViewTitlePart as ViewTitlePartLocators } from '../../locators/1.73.0'

export interface ViewTitlePart extends IPageDecorator<typeof ViewTitlePartLocators> { }
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/sidebar/WelcomeContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ViewSection } from '..'
import {
BasePage, PageDecorator, IPageDecorator, VSCodeLocatorMap
} from '../utils'
import { WelcomeContent as WelcomeContentLocators } from '../../locators/1.70.0'
import { WelcomeContent as WelcomeContentLocators } from '../../locators/1.73.0'

export interface WelcomeContentButton extends IPageDecorator<typeof WelcomeContentLocators> {}
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/sidebar/debug/DebugView.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SideBarView } from '../SideBarView'
import { PageDecorator, IPageDecorator } from '../../utils'
import { DebugView as DebugViewLocators } from '../../../locators/1.70.0'
import { DebugView as DebugViewLocators } from '../../../locators/1.73.0'

export interface DebugView extends IPageDecorator<typeof DebugViewLocators> { }
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/sidebar/extensions/ExtensionsViewItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { PageDecorator, IPageDecorator, VSCodeLocatorMap } from '../../utils'
import {
TreeItem as TreeItemLocators,
ExtensionsViewItem as ExtensionsViewItemLocators
} from '../../../locators/1.70.0'
} from '../../../locators/1.73.0'

export interface ExtensionsViewItem extends IPageDecorator<ViewItemLocators> { }
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { PageDecorator, IPageDecorator } from '../../utils'
import {
ViewSection as ViewSectionLocators,
ExtensionsViewSection as ExtensionsViewSectionLocators
} from '../../../locators/1.70.0'
} from '../../../locators/1.73.0'
import { CMD_KEY } from '../../../constants'

/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/sidebar/scm/NewScmView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ContextMenu } from '../..'
import {
PageDecorator, IPageDecorator, ElementWithContextMenu, VSCodeLocatorMap
} from '../../utils'
import { ScmView as ScmViewLocators } from '../../../locators/1.70.0'
import { ScmView as ScmViewLocators } from '../../../locators/1.73.0'
import { CMD_KEY } from '../../../constants'

export interface NewScmView extends IPageDecorator<typeof ScmViewLocators> { }
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/sidebar/scm/ScmView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ContextMenu } from '../..'
import {
ElementWithContextMenu, VSCodeLocatorMap, PageDecorator, IPageDecorator, BasePage
} from '../../utils'
import { ScmView as ScmViewLocators } from '../../../locators/1.70.0'
import { ScmView as ScmViewLocators } from '../../../locators/1.73.0'
import { CMD_KEY } from '../../../constants'

export interface ScmView extends IPageDecorator<typeof ScmViewLocators> { }
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/sidebar/tree/custom/CustomTreeItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { PageDecorator, IPageDecorator, VSCodeLocatorMap } from '../../../utils'
import {
TreeItem as TreeItemLocators,
CustomTreeItem as CustomTreeItemLocators
} from '../../../../locators/1.70.0'
} from '../../../../locators/1.73.0'

export interface CustomTreeItem extends IPageDecorator<ViewItemLocators> { }
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/sidebar/tree/custom/CustomTreeSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { PageDecorator, IPageDecorator } from '../../../utils'
import {
ViewSection as ViewSectionLocators,
CustomTreeSection as CustomTreeSectionLocators
} from '../../../../locators/1.70.0'
} from '../../../../locators/1.73.0'

export interface CustomTreeSection extends IPageDecorator<AllViewSectionLocators> { }
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/sidebar/tree/default/DefaultTreeItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { PageDecorator, IPageDecorator, VSCodeLocatorMap } from '../../../utils'
import {
TreeItem as TreeItemLocators,
DefaultTreeItem as DefaultTreeItemLocators
} from '../../../../locators/1.70.0'
} from '../../../../locators/1.73.0'

export interface DefaultTreeItem extends IPageDecorator<ViewItemLocators> { }
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/sidebar/tree/default/DefaultTreeSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { PageDecorator, IPageDecorator } from '../../../utils'
import {
ViewSection as ViewSectionLocators,
DefaultTreeSection as DefaultTreeSectionLocators
} from '../../../../locators/1.70.0'
} from '../../../../locators/1.73.0'

export interface DefaultTreeSection extends IPageDecorator<AllViewSectionLocators> { }
/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/statusBar/StatusBar.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PageDecorator, IPageDecorator, BasePage } from '../utils'
import { StatusBar as StatusBarLocators } from '../../locators/1.70.0'
import { StatusBar as StatusBarLocators } from '../../locators/1.73.0'
import { NotificationsCenter } from '..'

export interface StatusBar extends IPageDecorator<typeof StatusBarLocators> {}
Expand Down
Loading

0 comments on commit 604f71a

Please sign in to comment.