(filename: string, text: string, selectorPrefix = '')
| 87 | } |
| 88 | |
| 89 | async waitForTypeInEditor(filename: string, text: string, selectorPrefix = ''): Promise<any> { |
| 90 | if (text.includes('\n')) { |
| 91 | throw new Error('waitForTypeInEditor does not support new lines, use either a long single line or dispatchKeybinding(\'Enter\')'); |
| 92 | } |
| 93 | const editor = [selectorPrefix || '', EDITOR(filename)].join(' '); |
| 94 | |
| 95 | await this.code.waitForElement(editor); |
| 96 | |
| 97 | const editContext = `${editor} ${this._editContextSelector()}`; |
| 98 | await this.code.waitForActiveElement(editContext); |
| 99 | |
| 100 | await this.code.waitForTypeInEditor(editContext, text); |
| 101 | |
| 102 | await this.waitForEditorContents(filename, c => c.indexOf(text) > -1, selectorPrefix); |
| 103 | } |
| 104 | |
| 105 | async waitForEditorSelection(filename: string, accept: (selection: { selectionStart: number; selectionEnd: number }) => boolean): Promise<void> { |
| 106 | const selector = `${EDITOR(filename)} ${this._editContextSelector()}`; |
nothing calls this directly
no test coverage detected