Skip to content

Commit

Permalink
fix:
Browse files Browse the repository at this point in the history
    The locator selection by vscode version did not work, because the vscode version was overwritten by the underlying chrome version and "122" was larger than all vscode versions. The vscode version is now preserved and use for locator selection.

    As of vscode 1.87.0 the bottombar's outputChanel selector does not have an attribute title anymore. The locator for 1.87.0 was thus added.
  • Loading branch information
jan872 committed Sep 23, 2024
1 parent 78f45a9 commit d022533
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ export default class VSCodeServiceLauncher {
}

const version = cap[VSCODE_CAPABILITY_KEY].version || cap.browserVersion || DEFAULT_CHANNEL

cap[VSCODE_CAPABILITY_KEY].version = version

Check failure on line 91 in src/launcher.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, stable)

Trailing spaces not allowed

Check failure on line 91 in src/launcher.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 1.86.0)

Trailing spaces not allowed

Check failure on line 91 in src/launcher.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, web)

Trailing spaces not allowed

Check failure on line 91 in src/launcher.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, stable)

Trailing spaces not allowed

Check failure on line 91 in src/launcher.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 1.86.0)

Trailing spaces not allowed

Check failure on line 91 in src/launcher.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, web)

Trailing spaces not allowed
/**
* setup VSCode Desktop
*/
Expand Down
9 changes: 9 additions & 0 deletions src/locators/1.87.0.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { BottomBarViews as BottomBarViewsImport } from './1.84.0.js'

export * from './1.84.0.js'
export const locatorVersion = '1.87.0'

export const BottomBarViews = {
...BottomBarViewsImport,
outputChannels: 'ul[aria-label="Output actions"] select'
}
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.84.0.js'
} from './1.87.0.js'

export * from './1.84.0.js'
export * from './1.87.0.js'
export const locatorVersion = 'insiders'
export const QuickOpenBox = {
...QuickOpenBoxImport,
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/bottomBar/AbstractViews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export abstract class ChannelView<T> extends ElementWithContextMenu<T> {
*/
async getCurrentChannel (): Promise<string> {
const combo = await this.parent.$(this.locatorMap.BottomBarViews.channelCombo as string)
return combo.getAttribute('title')
return combo.getValue()
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/pageobjects/workbench/Input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export abstract class Input extends BasePage<AllInputLocators> {
*/
async getText (): Promise<string> {
const input = await this.inputBox$.$(this.locators.input)
return input.getAttribute('value')
return input.getValue()
}

/**
Expand Down
5 changes: 3 additions & 2 deletions src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,13 @@ export default class VSCodeWorkerService implements Services.ServiceInstance {
await browser.url('/')
}

const vsCodeVersion = capabilities[VSCODE_CAPABILITY_KEY]?.version || capabilities.browserVersion || 'insiders'
this._browser = browser
const locators = await getLocators(capabilities.browserVersion || 'insiders')
const locators = await getLocators(vsCodeVersion)
const workbenchPO = new Workbench(locators)
this._browser.addCommand('getWorkbench', () => workbenchPO.wait())
this._browser.addCommand('executeWorkbench', this._executeVSCode.bind(this))
this._browser.addCommand('getVSCodeVersion', () => capabilities.browserVersion)
this._browser.addCommand('getVSCodeVersion', () => vsCodeVersion)
this._browser.addCommand('isVSCodeWebSession', () => this._isWebSession)
this._browser.addCommand('getVSCodeChannel', () => (
capabilities.browserVersion === 'insiders' ? 'insiders' : 'vscode'
Expand Down

0 comments on commit d022533

Please sign in to comment.