Skip to content

Commit

Permalink
adapt smoke test to changes in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
kieferrm committed Jan 2, 2019
1 parent fa5306d commit df5a295
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions test/smoke/src/areas/preferences/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,16 @@ export const enum ActivityBarPosition {
RIGHT = 1
}

const SEARCH_INPUT = '.settings-search-input input';

export class SettingsEditor {

constructor(private code: Code, private userDataPath: string, private editors: Editors, private editor: Editor, private quickopen: QuickOpen) { }

async addUserSetting(setting: string, value: string): Promise<void> {
await this.openSettings();
await this.code.waitAndClick(SEARCH_INPUT);
await this.code.waitForActiveElement(SEARCH_INPUT);

await this.editor.waitForEditorFocus('settings.json', 1, '.editable-preferences-editor-container');
await this.editor.waitForEditorFocus('settings.json', 1);

await this.code.dispatchKeybinding('right');
await this.editor.waitForTypeInEditor('settings.json', `"${setting}": ${value}`, '.editable-preferences-editor-container');
await this.editor.waitForTypeInEditor('settings.json', `"${setting}": ${value}`);
await this.editors.saveOpenedFile();
}

Expand All @@ -38,7 +33,7 @@ export class SettingsEditor {
await new Promise((c, e) => fs.writeFile(settingsPath, '{}', 'utf8', err => err ? e(err) : c()));

await this.openSettings();
await this.editor.waitForEditorContents('settings.json', c => c === '{}', '.editable-preferences-editor-container');
await this.editor.waitForEditorContents('settings.json', c => c === '{}');
}

private async openSettings(): Promise<void> {
Expand Down

0 comments on commit df5a295

Please sign in to comment.