smoke: debug, wait for elements before clicking

This commit is contained in:
Joao Moreno 2017-09-08 23:18:19 +02:00
parent 680c3ac9d5
commit 1e5274d6be

View file

@ -47,40 +47,41 @@ export class Debug extends Viewlet {
}
async configure(): Promise<any> {
await this.spectron.client.click(CONFIGURE);
await this.spectron.client.waitAndClick(CONFIGURE);
await this.spectron.workbench.waitForEditorFocus('launch.json');
}
async setBreakpointOnLine(lineNumber: number): Promise<any> {
await this.spectron.client.waitForElement(`${GLYPH_AREA}(${lineNumber})`);
await this.spectron.client.leftClick(`${GLYPH_AREA}(${lineNumber})`, 5, 5);
await this.spectron.client.waitForElement(BREAKPOINT_GLYPH);
}
async startDebugging(): Promise<any> {
await this.spectron.client.click(START);
await this.spectron.client.waitAndClick(START);
await this.spectron.client.waitForElement(PAUSE);
await this.spectron.client.waitForElement(DEBUG_STATUS_BAR);
}
async stepOver(): Promise<any> {
await this.spectron.client.click(STEP_OVER);
await this.spectron.client.waitAndClick(STEP_OVER);
}
async stepIn(): Promise<any> {
await this.spectron.client.click(STEP_IN);
await this.spectron.client.waitAndClick(STEP_IN);
}
async stepOut(): Promise<any> {
await this.spectron.client.click(STEP_OUT);
await this.spectron.client.waitAndClick(STEP_OUT);
}
async continue(): Promise<any> {
await this.spectron.client.click(CONTINUE);
await this.spectron.client.waitAndClick(CONTINUE);
await this.waitForStackFrameLength(0);
}
async stopDebugging(): Promise<any> {
await this.spectron.client.click(STOP);
await this.spectron.client.waitAndClick(STOP);
await this.spectron.client.waitForElement(TOOLBAR_HIDDEN);
await this.spectron.client.waitForElement(NOT_DEBUG_STATUS_BAR);
}