Skip to content

Commit

Permalink
Bump 'max' placeholder to latest VS Code 1.83.0
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Jelinek <[email protected]>
  • Loading branch information
djelinek committed Oct 5, 2023
1 parent 8f1a515 commit 2bd561b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/insiders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.15.0
node-version: 18.15.x
cache: npm

- name: Run Tests (macOS, windows)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
version: [ min, 1.81.1, max ]
version: [ min, 1.82.3, max ]
fail-fast: false

env:
Expand All @@ -30,7 +30,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.15.0
node-version: 18.15.x
cache: npm

- name: Run Tests (macOS, windows)
Expand Down
48 changes: 21 additions & 27 deletions page-objects/src/components/editor/SettingsEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,12 @@ export class SettingsEditor extends Editor {
* @returns Promise resolving to a Setting object if found, undefined otherwise
*/
async findSetting(title: string, ...categories: string[]): Promise<Setting> {
const category = categories.join('');
const category = categories.join('>');
const searchBox = await this.findElement(SettingsEditor.locators.Editor.inputArea);
await searchBox.sendKeys(Key.chord(SettingsEditor.ctlKey, 'a'));
await searchBox.sendKeys(`${category}: ${title}`);
await searchBox.sendKeys(`${category}>${title}`);

let setting!: Setting;
const items = await this._getSettingItems();

for (const item of items) {
try {
return await (await this.createSetting(item, title, category)).wait();
} catch (err) {
}
}
return setting;
return await this._getSettingItem(title);
}

/**
Expand All @@ -56,24 +47,12 @@ export class SettingsEditor extends Editor {
await searchBox.sendKeys(Key.chord(SettingsEditor.ctlKey, 'a'));
await searchBox.sendKeys(id);

let setting!: Setting;
const items = await this._getSettingItems();

for (const item of items) {
try {
const category = (await (await item.findElement(SettingsEditor.locators.SettingsEditor.settingCategory)).getText()).replace(':', '');
const title = await (await item.findElement(SettingsEditor.locators.SettingsEditor.settingLabel)).getText();
return await (await this.createSetting(item, title, category)).wait();
} catch (err) {
}
}
return setting;
return await this._getSettingItem();
}

private async _getSettingItems(): Promise<WebElement[]> {
private async _getSettingItem(title: string = ''): Promise<Setting> {
const count = await this.findElement(SettingsEditor.locators.SettingsEditor.itemCount);
let textCount = await count.getText();

await this.getDriver().wait(async() => {
await new Promise(res => setTimeout(res, 1500));
const text = await count.getText();
Expand All @@ -84,7 +63,22 @@ export class SettingsEditor extends Editor {
return true;
});

return await this.findElements(SettingsEditor.locators.SettingsEditor.itemRow);
let setting!: Setting;
const items = await this.findElements(SettingsEditor.locators.SettingsEditor.itemRow);
for (const item of items) {
try {
const _category = (await (await item.findElement(SettingsEditor.locators.SettingsEditor.settingCategory)).getText()).replace(':', '');
const _title = await (await item.findElement(SettingsEditor.locators.SettingsEditor.settingLabel)).getText();
if(title.length > 0) {
if(title !== _title) {
continue;
}
}
return await (await this.createSetting(item, _title, _category)).wait();
} catch (err) {
}
}
return setting;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/extester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export const DEFAULT_SETUP_OPTIONS = {
installDependencies: false
}

export const VSCODE_VERSION_MIN = '1.80.2';
export const VSCODE_VERSION_MAX = '1.82.3';
export const VSCODE_VERSION_MIN = '1.81.1';
export const VSCODE_VERSION_MAX = '1.83.0';

/**
* VSCode Extension Tester
Expand Down
2 changes: 1 addition & 1 deletion test/test-project/src/test/editor/settingsEditor-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Settings Editor', function () {

it('findSetting by ID works', async function () {
this.timeout(15000);
const setting = await editor.findSettingByID('testProject.general.helloWorld');
const setting = await editor.findSettingByID('workbench.editor.enablePreview');
expect(setting).not.undefined;
});

Expand Down

0 comments on commit 2bd561b

Please sign in to comment.