MCPcopy
hub / github.com/microsoft/vscode / waitForTextContent

Method waitForTextContent

test/automation/src/code.ts:267–276  ·  view source on GitHub ↗
(selector: string, textContent?: string, accept?: (result: string) => boolean, retryCount?: number)

Source from the content-addressed store, hash-verified

265 }
266
267 async waitForTextContent(selector: string, textContent?: string, accept?: (result: string) => boolean, retryCount?: number): Promise<string> {
268 accept = accept || (result => textContent !== undefined ? textContent === result : !!result);
269
270 return await this.poll(
271 () => this.driver.getElements(selector).then(els => els.length > 0 ? Promise.resolve(els[0].textContent) : Promise.reject(new Error('Element not found for textContent'))),
272 s => accept!(typeof s === 'string' ? s : ''),
273 `get text content '${selector}'`,
274 retryCount
275 );
276 }
277
278 async waitAndClick(selector: string, xoffset?: number, yoffset?: number, retryCount: number = 200): Promise<void> {
279 await this.poll(() => this.driver.click(selector, xoffset, yoffset), () => true, `click '${selector}'`, retryCount);

Callers 15

waitForTitleFunction · 0.80
searchForExtensionMethod · 0.80
waitForEOLMethod · 0.80
waitForStatusbarTextMethod · 0.80
waitForEditorContentsMethod · 0.80
checkWindowReadyMethod · 0.80
waitForResultTextMethod · 0.80
waitForNoResultTextMethod · 0.80

Calls 5

pollMethod · 0.95
thenMethod · 0.65
getElementsMethod · 0.65
resolveMethod · 0.65
rejectMethod · 0.65

Tested by

no test coverage detected