Skip to content

Commit a1b2f26

Browse files
committed
more cleanup
1 parent 225d7e5 commit a1b2f26

3 files changed

Lines changed: 5 additions & 11 deletions

File tree

test/smoke/src/areas/debug/debug.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ const DEBUG_STATUS_BAR = `.statusbar.debugging`;
2222
const NOT_DEBUG_STATUS_BAR = `.statusbar:not(debugging)`;
2323
const TOOLBAR_HIDDEN = `.debug-actions-widget.monaco-builder-hidden`;
2424
const STACK_FRAME = `${VIEWLET} .monaco-tree-row .stack-frame`;
25+
const SPECIFIC_STACK_FRAME = filename => `${STACK_FRAME} .file[title$="${filename}"]`;
2526
const VARIABLE = `${VIEWLET} .debug-variables .monaco-tree-row .expression`;
2627
const CONSOLE_OUTPUT = `.repl .output.expression`;
2728
const CONSOLE_INPUT_OUTPUT = `.repl .input-output-pair .output.expression .value`;
2829

2930
const REPL_FOCUSED = '.repl-input-wrapper .monaco-editor textarea';
3031

3132
export interface IStackFrame {
32-
id: string;
3333
name: string;
3434
lineNumber: number;
3535
}
@@ -102,12 +102,11 @@ export class Debug extends Viewlet {
102102
}
103103

104104
async waitForStackFrameLength(length: number): Promise<any> {
105-
return await this.spectron.client.waitFor(() => this.getStackFrames(), stackFrames => stackFrames.length === length);
105+
await this.spectron.client.waitForElements(STACK_FRAME, result => result.length === length);
106106
}
107107

108108
async focusStackFrame(name: string, message: string): Promise<any> {
109-
const stackFrame = await this.waitForStackFrame(sf => sf.name === name, message);
110-
await this.spectron.client.spectron.client.elementIdClick(stackFrame.id);
109+
await this.spectron.client.waitAndClick(SPECIFIC_STACK_FRAME(name));
111110
await this.spectron.workbench.waitForTab(name);
112111
}
113112

@@ -130,11 +129,6 @@ export class Debug extends Viewlet {
130129
return await this.spectron.webclient.selectorExecute(VARIABLE, div => (Array.isArray(div) ? div : [div]).length);
131130
}
132131

133-
async getStackFramesLength(): Promise<number> {
134-
const stackFrames = await this.getStackFrames();
135-
return stackFrames.length;
136-
}
137-
138132
private async getStackFrames(): Promise<IStackFrame[]> {
139133
const result = await this.spectron.webclient.selectorExecute(STACK_FRAME,
140134
div => (Array.isArray(div) ? div : [div]).map(element => {

test/smoke/src/areas/editor/editor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export class Editor {
109109
await this.spectron.client.waitForActiveElement(textarea);
110110

111111
// https://github.com/Microsoft/vscode/issues/34203#issuecomment-334441786
112-
await this.spectron.client.spectron.client.selectorExecute(textarea, (elements, text) => {
112+
await this.spectron.webclient.selectorExecute(textarea, (elements, text) => {
113113
const textarea = (Array.isArray(elements) ? elements : [elements])[0] as HTMLTextAreaElement;
114114
const start = textarea.selectionStart;
115115
const newStart = start + text.length;

test/smoke/src/spectron/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class SpectronClient {
1515
private readonly retryDuration = 100; // in milliseconds
1616

1717
constructor(
18-
readonly spectron: Application,
18+
private spectron: Application,
1919
private application: SpectronApplication,
2020
waitTime: number
2121
) {

0 commit comments

Comments
 (0)