smoke - remove doubleClick usage

This commit is contained in:
Benjamin Pasero 2021-12-16 14:27:21 +01:00
parent fdc4b7101d
commit fa739870a2
No known key found for this signature in database
GPG key ID: E6380CC4C8219E65
4 changed files with 3 additions and 17 deletions

View file

@ -238,11 +238,6 @@ export class Code {
await poll(() => this.driver.click(windowId, selector, xoffset, yoffset), () => true, this.logger, `click '${selector}'`, retryCount);
}
async waitAndDoubleClick(selector: string): Promise<void> {
const windowId = await this.getActiveWindowId();
await poll(() => this.driver.doubleClick(windowId, selector), () => true, this.logger, `double click '${selector}'`);
}
async waitForSetValue(selector: string, value: string): Promise<void> {
const windowId = await this.getActiveWindowId();
await poll(() => this.driver.setValue(windowId, selector, value), () => true, this.logger, `set value '${selector}'`);

View file

@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
import { Viewlet } from './viewlet';
import { Editors } from './editors';
import { Code } from './code';
export class Explorer extends Viewlet {
@ -12,7 +11,7 @@ export class Explorer extends Viewlet {
private static readonly EXPLORER_VIEWLET = 'div[id="workbench.view.explorer"]';
private static readonly OPEN_EDITORS_VIEW = `${Explorer.EXPLORER_VIEWLET} .split-view-view:nth-child(1) .title`;
constructor(code: Code, private editors: Editors) {
constructor(code: Code) {
super(code);
}
@ -28,11 +27,6 @@ export class Explorer extends Viewlet {
await this.code.waitForTextContent(Explorer.OPEN_EDITORS_VIEW, undefined, fn);
}
async openFile(fileName: string): Promise<any> {
await this.code.waitAndDoubleClick(`div[class="monaco-icon-label file-icon ${fileName}-name-file-icon ${this.getExtensionSelector(fileName)} explorer-item"]`);
await this.editors.waitForEditorFocus(fileName);
}
getExtensionSelector(fileName: string): string {
const extension = fileName.split('.')[1];
if (extension === 'js') {

View file

@ -137,10 +137,7 @@ class PlaywrightDriver implements IDriver {
}
async doubleClick(windowId: number, selector: string) {
await this.click(windowId, selector, 0, 0);
await this.timeout(60);
await this.click(windowId, selector, 0, 0);
await this.timeout(100);
throw new Error('Unsupported');
}
async setValue(windowId: number, selector: string, text: string) {

View file

@ -50,7 +50,7 @@ export class Workbench {
this.editors = new Editors(code);
this.quickinput = new QuickInput(code);
this.quickaccess = new QuickAccess(code, this.editors, this.quickinput);
this.explorer = new Explorer(code, this.editors);
this.explorer = new Explorer(code);
this.activitybar = new ActivityBar(code);
this.search = new Search(code);
this.extensions = new Extensions(code);